aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-03-24 18:04:30 +0100
committerDavid Robillard <d@drobilla.net>2019-03-24 21:23:02 +0100
commit4425f09db6a4cad5aaf949f16e89181c45992b15 (patch)
treede164a0b057324b7d22d7f2bf790bd3b308d7a28
parentc9c797900f247c80fada6bdabf4bee0aa3283341 (diff)
downloadlv2-4425f09db6a4cad5aaf949f16e89181c45992b15.tar.xz
Make index column headers link to the corresponding section
-rwxr-xr-xlv2specgen/lv2specgen.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py
index fe188ec..0c6adb1 100755
--- a/lv2specgen/lv2specgen.py
+++ b/lv2specgen/lv2specgen.py
@@ -752,7 +752,7 @@ def buildIndex(m, classlist, proplist, instalist=None, filelist=None):
return '<a href="%s">%s</a>' % (str(t), str(t))
if (len(classlist) > 0):
- head += '<th>Classes</th>'
+ head += '<th><a href="#ref-classes" />Classes</th>'
body += '<td><ul>'
classlist.sort()
shown = {}
@@ -792,7 +792,7 @@ def buildIndex(m, classlist, proplist, instalist=None, filelist=None):
body += '</ul></td>\n'
if (len(proplist) > 0):
- head += '<th>Properties</th>'
+ head += '<th><a href="#ref-properties" />Properties</th>'
body += '<td><ul>'
proplist.sort()
for p in proplist:
@@ -800,7 +800,7 @@ def buildIndex(m, classlist, proplist, instalist=None, filelist=None):
body += '</ul></td>\n'
if (instalist is not None and len(instalist) > 0):
- head += '<th>Instances</th>'
+ head += '<th><a href="#ref-instances" />Instances</th>'
body += '<td><ul>'
instalist.sort()
for i in instalist:
@@ -1304,10 +1304,18 @@ def specgen(specloc, indir, style_uri, docdir, tags, opts, instances=False, root
azlist = buildIndex(m, classlist, proplist, instalist, filelist)
# Generate Term HTML
- termlist = docTerms('Property', proplist, m, classlist, proplist, instalist)
- termlist = docTerms('Class', classlist, m, classlist, proplist, instalist) + termlist
+ classlist = docTerms('Class', classlist, m, classlist, proplist, instalist)
+ proplist = docTerms('Property', proplist, m, classlist, proplist, instalist)
if instances:
- termlist += docTerms('Instance', instalist, m, classlist, proplist, instalist)
+ instlist = docTerms('Instance', instalist, m, classlist, proplist, instalist)
+
+ termlist = ''
+ if classlist:
+ termlist += '<h3><a id="ref-classes" />Classes</h3>' + classlist
+ if proplist:
+ termlist += '<h3><a id="ref-properties" />Properties</h3>' + proplist
+ if instlist:
+ termlist += '<h3><a id="ref-instances" />Instances</h3>' + instlist
name = specProperty(m, spec, doap.name)
title = name