aboutsummaryrefslogtreecommitdiffstats
path: root/lv2specgen
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 /lv2specgen
parent939bd6476157c2110cb5fa658ad8b4145ce7a236 (diff)
downloadlv2-7ea2b2bf56cfd5c4c8abfe8674ccda3c7e179132.tar.xz
lv2specgen: Fix links to externally defined terms.
Diffstat (limited to 'lv2specgen')
-rwxr-xr-xlv2specgen/lv2specgen.py20
1 files changed, 10 insertions, 10 deletions
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):