Browse Source

Add link to spec index on spec pages.

zrythm_meson
David Robillard 8 years ago
parent
commit
3ec294f44b
  1. 8
      lv2specgen/lv2specgen.py
  2. 10
      wscript

8
lv2specgen/lv2specgen.py

@ -1113,7 +1113,7 @@ def load_tags(path, docdir): @@ -1113,7 +1113,7 @@ def load_tags(path, docdir):
return linkmap
def specgen(specloc, indir, style_uri, docdir, tags, opts, instances=False):
def specgen(specloc, indir, style_uri, docdir, tags, opts, instances=False, root_link=None):
"""The meat and potatoes: Everything starts here."""
global spec_url
@ -1221,7 +1221,11 @@ def specgen(specloc, indir, style_uri, docdir, tags, opts, instances=False): @@ -1221,7 +1221,11 @@ def specgen(specloc, indir, style_uri, docdir, tags, opts, instances=False):
if instances:
termlist += docTerms('Instance', instalist, m, classlist, proplist, instalist)
template = template.replace('@NAME@', specProperty(m, spec, doap.name))
name = specProperty(m, spec, doap.name)
if root_link:
name = '<a href="%s">%s</a>' % (root_link, name)
template = template.replace('@NAME@', name)
template = template.replace('@SHORT_DESC@', specProperty(m, spec, doap.shortdesc))
template = template.replace('@URI@', spec)
template = template.replace('@PREFIX@', spec_pre)

10
wscript

@ -165,6 +165,13 @@ def specgen(task): @@ -165,6 +165,13 @@ def specgen(task):
if name.startswith('LV2 '):
name = name[4:]
# Root link
ctx = task.generator.bld
root_path = path[0:path.find('ns/') + 3]
root_link = os.path.relpath(root_path, path)
if not task.generator.bld.env.ONLINE_DOCS:
root_link = os.path.join(root_link, 'index.html')
SPECGENDIR = 'lv2specgen'
STYLEPATH = 'build/aux/style.css'
TAGFILE = 'build/doc/tags'
@ -177,7 +184,8 @@ def specgen(task): @@ -177,7 +184,8 @@ def specgen(task):
TAGFILE,
{ 'list_email': 'devel@lists.lv2plug.in',
'list_page': 'http://lists.lv2plug.in/listinfo.cgi/devel-lv2plug.in' },
instances=True)
instances=True,
root_link=root_link)
lv2specgen.save(task.outputs[0].abspath(), specdoc)

Loading…
Cancel
Save