aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-12-31 01:01:56 +0000
committerDavid Robillard <d@drobilla.net>2013-12-31 01:01:56 +0000
commit7ea2b2bf56cfd5c4c8abfe8674ccda3c7e179132 (patch)
tree1f43b02cc2ddc4adedef6abf5724887f9e4544a4
parent939bd6476157c2110cb5fa658ad8b4145ce7a236 (diff)
downloadlv2-7ea2b2bf56cfd5c4c8abfe8674ccda3c7e179132.tar.xz
lv2specgen: Fix links to externally defined terms.
-rw-r--r--lv2/lv2plug.in/ns/meta/meta.ttl4
-rwxr-xr-xlv2specgen/lv2specgen.py20
2 files changed, 13 insertions, 11 deletions
diff --git a/lv2/lv2plug.in/ns/meta/meta.ttl b/lv2/lv2plug.in/ns/meta/meta.ttl
index 94c8dd5..a88345d 100644
--- a/lv2/lv2plug.in/ns/meta/meta.ttl
+++ b/lv2/lv2plug.in/ns/meta/meta.ttl
@@ -48,12 +48,14 @@ THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH R
meta:kfoltman ,
meta:paniq ;
doap:release [
- doap:revision "1.6.1" ;
+ doap:revision "1.6.2" ;
doap:created "2013-10-15" ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add scope example plugin from Robin Gareus."
+ ] , [
+ rdfs:label "lv2specgen: Fix links to externally defined terms."
]
]
] , [
diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py
index efbf053..4ea301a 100755
--- a/lv2specgen/lv2specgen.py
+++ b/lv2specgen/lv2specgen.py
@@ -726,6 +726,13 @@ def buildIndex(m, classlist, proplist, instalist=None):
azlist = '<dl class="index">'
+ def termLink(m, t):
+ if str(t).startswith(spec_ns_str):
+ name = termName(m, t)
+ return '<a href="#%s">%s</a>' % (name, name)
+ else:
+ return '<a href="%s">%s</a>' % (str(t), str(t))
+
if (len(classlist) > 0):
azlist += "<dt>Classes</dt><dd><ul>"
classlist.sort()
@@ -744,10 +751,7 @@ def buildIndex(m, classlist, proplist, instalist=None):
continue
shown[c] = True
- name = termName(m, c)
- if name.startswith(spec_ns_str):
- name = name.split(spec_ns_str[-1])[1]
- azlist += '<li><a href="#%s">%s</a>' % (name, name)
+ azlist += '<li>' + termLink(m, c)
def class_tree(c):
tree = ''
shown[c] = True
@@ -758,8 +762,7 @@ def buildIndex(m, classlist, proplist, instalist=None):
subclasses.sort()
for s in subclasses:
- s_name = termName(m, s)
- tree += '<li><a href="#%s">%s</a>\n' % (s_name, s_name)
+ tree += '<li>' + termLink(m, s)
tree += class_tree(s)
tree += '</li>'
if tree != '':
@@ -774,10 +777,7 @@ def buildIndex(m, classlist, proplist, instalist=None):
proplist.sort()
props = []
for p in proplist:
- name = termName(m, p)
- if name.startswith(spec_ns_str):
- name = name.split(spec_ns_str[-1])[1]
- props += ['<a href="#%s">%s</a>' % (name, name)]
+ props += [termLink(m, p)]
azlist += ', '.join(props) + '</dd>\n'
if (instalist != None and len(instalist) > 0):