From b98dbcdddff0d758bfeddace5535bdcd4bce174a Mon Sep 17 00:00:00 2001 From: Lars Luthman Date: Fri, 11 Mar 2011 22:26:38 +0000 Subject: lv2specgen.py creates links for every mention of a header file, preprocessor define, data structure etc --- gendoc.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'gendoc.py') diff --git a/gendoc.py b/gendoc.py index 3ce14b3..94b6814 100755 --- a/gendoc.py +++ b/gendoc.py @@ -21,6 +21,7 @@ URIPREFIX = 'http://lv2plug.in/ns/' DOXPREFIX = 'http://lv2plug.in/ns/doc/html/' SPECGENDIR = './specgen' STYLEURI = os.path.join('aux', 'style.css') +TAGFILE = './doclinks' release_dir = os.path.join('build', 'spec') try: @@ -51,14 +52,17 @@ def getChildText(elt, tagname): tagdoc = xml.dom.minidom.parse('c_tags') root = tagdoc.documentElement -bettertags = open('c_bettertags', 'w') +bettertags = open(TAGFILE, 'w') for cn in root.childNodes: if cn.nodeType == xml.dom.Node.ELEMENT_NODE and cn.tagName == 'compound': if cn.getAttribute('kind') == 'page': continue name = getChildText(cn, 'name') filename = getChildText(cn, 'filename') - bettertags.write('%s %s%s.html\n' % (name, DOXPREFIX, filename)) + # Sometimes the .html is there, sometimes it isn't... + if filename[-5:] != '.html': + filename += '.html' + bettertags.write('%s %s%s\n' % (name, DOXPREFIX, filename)) if cn.getAttribute('kind') == 'file': prefix = '' else: @@ -88,6 +92,7 @@ def gendoc(specgen_dir, bundle_dir, ttl_filename, html_filename): STYLEURI, os.path.join(out_base, html_filename), os.path.join('..', '..'), + TAGFILE, '-i']) gendoc('./lv2specgen', 'core.lv2', 'lv2.ttl', 'lv2core/lv2core.html') @@ -163,6 +168,7 @@ SELECT ?rev FROM <%s.lv2/%s.ttl> WHERE { <%s> doap:release [ doap:revision ?rev STYLEURI, '%s.lv2/%s.html' % (b, b), os.path.join('..', '..', '..'), + os.path.join('..', '..', '..', TAGFILE), '-i'], cwd=outdir); li = '
  • ' -- cgit v1.2.1