aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-09-03 01:41:19 +0000
committerDavid Robillard <d@drobilla.net>2012-09-03 01:41:19 +0000
commit2b809fbf4090ae64d728988454c4f1b721f4c323 (patch)
tree058a94acba951f2d8805d6d2c625079929068c75
parent838005bbfc51a1cfb042b2cbc11d5cc2a88683a2 (diff)
downloadlv2-2b809fbf4090ae64d728988454c4f1b721f4c323.tar.xz
Use relative links between extensions so local documentation links work.
Automatically link prefixed names to the appropriate resource.
-rw-r--r--doc/reference.doxygen.in2
-rw-r--r--lv2/lv2plug.in/ns/ext/atom/atom.ttl5
-rw-r--r--lv2/lv2plug.in/ns/ext/buf-size/buf-size.ttl6
-rw-r--r--lv2/lv2plug.in/ns/ext/midi/midi.ttl4
-rw-r--r--lv2/lv2plug.in/ns/ext/parameters/parameters.ttl7
-rw-r--r--lv2/lv2plug.in/ns/ext/patch/patch.ttl12
-rw-r--r--lv2/lv2plug.in/ns/ext/state/state.ttl20
-rw-r--r--lv2/lv2plug.in/ns/ext/uri-map/uri-map.ttl2
-rw-r--r--lv2/lv2plug.in/ns/ext/urid/urid.ttl8
-rwxr-xr-xlv2specgen/lv2specgen.py40
10 files changed, 50 insertions, 56 deletions
diff --git a/doc/reference.doxygen.in b/doc/reference.doxygen.in
index 8db28a0..88fe7ea 100644
--- a/doc/reference.doxygen.in
+++ b/doc/reference.doxygen.in
@@ -961,7 +961,7 @@ HTML_COLORSTYLE_GAMMA = 100
# page will contain the date and time when the page was generated. Setting
# this to NO can help when comparing the output of multiple runs.
-HTML_TIMESTAMP = YES
+HTML_TIMESTAMP = NO
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
diff --git a/lv2/lv2plug.in/ns/ext/atom/atom.ttl b/lv2/lv2plug.in/ns/ext/atom/atom.ttl
index a09af81..94948a6 100644
--- a/lv2/lv2plug.in/ns/ext/atom/atom.ttl
+++ b/lv2/lv2plug.in/ns/ext/atom/atom.ttl
@@ -28,7 +28,7 @@ meaningfully process atoms of a type unknown to them.</p>
<p>Atoms can and should be used anywhere values of various types must be stored
or transmitted. The port type atom:AtomPort can be used to transmit atoms via
ports. The atom:Sequence type in an atom:AtomPort replaces the <a
-href="http://lv2plug.in/ns/ext/event">LV2 event</a> extension.</p>
+href="../event/event.html">LV2 event</a> extension.</p>
<p>The types defined in this extension should be powerful enough to express
almost any structure. Implementations SHOULD build structures out of the types
@@ -38,8 +38,7 @@ implementation burden which harms interoperabilty, and should only be defined
where absolutely necessary.</p>
<p>Implementing this extension requires a facility for mapping URIs to
-integers, such as the <a href="http://lv2plug.in/ns/ext/urid">LV2 URID</a>
-extension.</p>
+integers, such as the <a href="../urid/urid.html">LV2 URID</a> extension.</p>
<h3>Serialisation</h3>
diff --git a/lv2/lv2plug.in/ns/ext/buf-size/buf-size.ttl b/lv2/lv2plug.in/ns/ext/buf-size/buf-size.ttl
index 9313b11..be23c38 100644
--- a/lv2/lv2plug.in/ns/ext/buf-size/buf-size.ttl
+++ b/lv2/lv2plug.in/ns/ext/buf-size/buf-size.ttl
@@ -16,9 +16,9 @@ block length (the sample_count parameter of LV2_Descriptor::run) and
port buffer sizes, as well as several features which can be used to restrict
the block length.</p>
-<p>This extension only defines data-only features and properties and has no C
-API of its own. The host provides all the relevant information to the plugin as <a
-href="http://lv2plug.in/ns/ext/options#options">options</a></p>
+<p>This extension defines features and properties but has no special purpose
+API of its own. The host provides all the relevant information to the plugin
+as <a href="../options/options.html#options">options</a>.</p>
<p>To require restrictions on the block length, plugins can require additional
features: bufsz:boundedBlockLength, bufsz:powerOf2BlockLength, and
diff --git a/lv2/lv2plug.in/ns/ext/midi/midi.ttl b/lv2/lv2plug.in/ns/ext/midi/midi.ttl
index a9153e8..faddc36 100644
--- a/lv2/lv2plug.in/ns/ext/midi/midi.ttl
+++ b/lv2/lv2plug.in/ns/ext/midi/midi.ttl
@@ -20,8 +20,8 @@ controlling digital music devices.</p>
<p>For plugins that process MIDI (or other situations where MIDI is sent via a
generic transport) the main type defined here, midi:MidiEvent, can be mapped to
an integer and used as the type of an LV2 <a
-href="http://lv2plug.in/ns/ext/atom#Atom">Atom</a> or <a
-href="http://lv2plug.in/ns/ext/event#Event">Event</a>.</p>
+href="../atom/atom.html#Atom">Atom</a> or <a
+href="../event/event.html#Event">Event</a>.</p>
<p>This specification also defines a complete human and machine readable
description of the MIDI standard (except for standard controller numbers).
diff --git a/lv2/lv2plug.in/ns/ext/parameters/parameters.ttl b/lv2/lv2plug.in/ns/ext/parameters/parameters.ttl
index 87ee8d6..8f05f74 100644
--- a/lv2/lv2plug.in/ns/ext/parameters/parameters.ttl
+++ b/lv2/lv2plug.in/ns/ext/parameters/parameters.ttl
@@ -11,10 +11,9 @@
lv2:documentation """
<p>This vocabulary describes parameters common in audio processing software. A
<q>parameter</q> is purely a metadata concept, unrelated to any particular code
-mechanism. Parameters are used to assign meaning to controls (e.g. using <a
-href="http://lv2plug.in/ns/lv2core#designation">lv2:designation</a>) so they
-can be used more intelligently or presented to the user more efficiently.</p>
-""" .
+mechanism. Parameters are used to assign meaning to controls (e.g. using
+lv2:designation for ports) so they can be used more intelligently or presented
+to the user more efficiently.</p> """ .
param:ControlGroup
a rdfs:Class ;
diff --git a/lv2/lv2plug.in/ns/ext/patch/patch.ttl b/lv2/lv2plug.in/ns/ext/patch/patch.ttl
index 17f13cc..6267c71 100644
--- a/lv2/lv2plug.in/ns/ext/patch/patch.ttl
+++ b/lv2/lv2plug.in/ns/ext/patch/patch.ttl
@@ -17,9 +17,9 @@ plugins, but is useful in many contexts.</p>
<p>The main feature of this design is that the messages themselves are
described in the same format as the data they work with. In particular,
-messages can be serialised as an <a
-href="http://lv2plug.in/ns/ext/atom#Object">LV2 Object</a> or in Turtle (or any
-other RDF serialisation).</p>
+messages can be serialised as a binary <a
+href="../atom/atom.html#Object">Object</a> or in Turtle (or any other RDF
+serialisation).</p>
<p>The idea behind using a property-based interface for control is to prevent
an an explosion of message types. Instead of a custom message for each action,
@@ -37,9 +37,9 @@ One benefit of this approach is that a persistent state model is available
<p>This specification is strictly metadata and does not define any binary
mechanism, though it can be completely expressed by standard types in the <a
-href="http://lv2plug.in/ns/ext/atom">LV2 Atom</a> extension. Thus, hosts can
-be expected to be capable of transmitting it between plugins, or between a
-plugin and its UI, making it a good choice for advanced plugin control.</p>
+href="../atom/atom.html">LV2 Atom</a> extension. Thus, hosts can be expected
+to be capable of transmitting it between plugins, or between a plugin and its
+UI, making it a good choice for advanced plugin control.</p>
""" .
patch:Ack
diff --git a/lv2/lv2plug.in/ns/ext/state/state.ttl b/lv2/lv2plug.in/ns/ext/state/state.ttl
index 751a6e3..a9b997c 100644
--- a/lv2/lv2plug.in/ns/ext/state/state.ttl
+++ b/lv2/lv2plug.in/ns/ext/state/state.ttl
@@ -45,10 +45,10 @@ single property. The host is free to implement property storage and retrieval
in any way.</p>
<p>Since value types are defined by URI, any type is possible. However, a set
-of standard types is defined by the <a href="http://lv2plug.in/ns/ext/atom">LV2
-Atom</a> extension. Use of these types is recommended. Hosts MUST implement
-at least <a href="http://lv2plug.in/ns/ext/atom#String">atom:String</a>, which
-is simply a C string.</p>
+of standard types is defined by the <a href="../atom/atom.html">LV2 Atom</a>
+extension. Use of these types is recommended. Hosts MUST implement at least
+<a href="../atom/atom.html#String">atom:String</a>, which is simply a C
+string.</p>
<h3>Referring to Files</h3>
@@ -56,8 +56,7 @@ is simply a C string.</p>
state. This is done by storing the file's path as a property just like any
other value. However, there are some rules which MUST be followed when storing
paths, see state:mapPath for details. Plugins MUST use the type <a
-href="http://lv2plug.in/ns/ext/atom#Path">atom:Path</a> for all paths in their
-state.</p>
+href="../atom/atom.html#Path">atom:Path</a> for all paths in their state.</p>
<p>Plugins are strongly encouraged to avoid creating files, instead storing all
state as properties. However, occasionally the ability to create files is
@@ -206,11 +205,10 @@ plugins.</p>
<q>Don't stop; set playing to false</q>.</p>
<p>This extension does not define a dynamic mechanism for state access and
-manipulation. The <a href="http://lv2plug.in/ns/ext/patch">LV2 Patch</a>
-extension defines a generic set of messages which can be used to access or
-manipulate properties, and the <a href="http://lv2plug.in/ns/ext/atom">LV2
-Atom</a> extension defines a port type and data container capable of
-transmitting those messages.</p>
+manipulation. The <a href="../patch/patch.html">LV2 Patch</a> extension
+defines a generic set of messages which can be used to access or manipulate
+properties, and the <a href="../atom/atom.html">LV2 Atom</a> extension defines
+a port type and data container capable of transmitting those messages.</p>
""" .
state:interface
diff --git a/lv2/lv2plug.in/ns/ext/uri-map/uri-map.ttl b/lv2/lv2plug.in/ns/ext/uri-map/uri-map.ttl
index 96acbcd..7f6b0e7 100644
--- a/lv2/lv2plug.in/ns/ext/uri-map/uri-map.ttl
+++ b/lv2/lv2plug.in/ns/ext/uri-map/uri-map.ttl
@@ -11,7 +11,7 @@
<lv2-uri-map.doap.ttl> ;
lv2:documentation """
<p><span class="warning">This extension is deprecated.</span> New
-implementations should use <a href="http://lv2plug.in/ns/ext/urid">LV2 URID</a>
+implementations should use <a href="../urid/urid.html">LV2 URID</a>
instead.</p>
<p>This extension defines a simple mechanism for plugins to map URIs to
diff --git a/lv2/lv2plug.in/ns/ext/urid/urid.ttl b/lv2/lv2plug.in/ns/ext/urid/urid.ttl
index 3b8adcd..29b196a 100644
--- a/lv2/lv2plug.in/ns/ext/urid/urid.ttl
+++ b/lv2/lv2plug.in/ns/ext/urid/urid.ttl
@@ -15,10 +15,10 @@ thread without doing any string comparison. This allows for the extensibility
of RDF but with the performance of integers.</p>
<p>This extension is intended as an improved and simplified replacement for the
-<a href="http://lv2plug.in/ns/ext/uri-map">uri-map</a> extension, since the
-<q>map</q> context parameter has been found problematic. This extension is
-functionally equivalent to the uri-map extension with a NULL context. New
-implementations are encouraged to use this extension for URI mapping.</p>
+<a href="../uri-map/uri-map.html">uri-map</a> extension, since the <q>map</q>
+context parameter has been found problematic. This extension is functionally
+equivalent to the uri-map extension with a NULL context. New implementations
+are encouraged to use this extension for URI mapping.</p>
""" .
urid:map
diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py
index 37b2cef..9974265 100755
--- a/lv2specgen/lv2specgen.py
+++ b/lv2specgen/lv2specgen.py
@@ -277,28 +277,26 @@ def getComment(m, urinode, classlist, proplist, instalist):
# Add links to code documentation for identifiers
markup = linkify(markup)
- # Replace ext:ClassName with link to appropriate fragment
- rgx = re.compile(spec_pre + ':([A-Z][a-zA-Z0-9_-]*)')
- def translateClassLink(match):
+ # Transform prefixed names like eg:something into links if possible
+ rgx = re.compile('([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)')
+ namespaces = getNamespaces(m)
+ def translateLink(match):
+ text = match.group(0)
+ prefix = match.group(1)
+ name = match.group(2)
curie = match.group(0)
- name = curie[curie.find(':') + 1:]
- uri = spec_ns + name
- if rdflib.URIRef(uri) not in classlist:
- print("warning: Link to undefined class %s\n" % curie)
- return '<a href="#%s">%s</a>' % (name, curie)
- markup = rgx.sub(translateClassLink, markup)
-
- # Replace ext:instanceName with link to appropriate fragment
- rgx = re.compile(spec_pre + ':([a-z][a-zA-Z0-9_-]*)')
- def translateInstanceLink(match):
- curie = match.group(0)
- name = curie[curie.find(':') + 1:]
- uri = spec_ns + name
- if (rdflib.URIRef(uri) not in instalist and
- rdflib.URIRef(uri) not in proplist):
- print("warning: Link to undefined instance/property %s\n" % curie)
- return '<a href="#%s">%s</a>' % (name, curie)
- markup = rgx.sub(translateInstanceLink, markup)
+ uri = rdflib.URIRef(spec_ns + name)
+ if prefix == spec_pre:
+ if not (uri in classlist or uri in instalist or uri in proplist):
+ print("warning: Link to undefined resource <%s>\n" % text)
+ return '<a href="#%s">%s</a>' % (name, curie)
+ elif prefix in namespaces:
+ return '<a href="%s">%s</a>' % (
+ namespaces[match.group(1)] + match.group(2),
+ match.group(0))
+ else:
+ return text
+ markup = rgx.sub(translateLink, markup)
if have_lxml:
try: