aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xlv2specgen/lv2specgen.py48
-rw-r--r--wscript4
2 files changed, 16 insertions, 36 deletions
diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py
index edef5ea..d85a626 100755
--- a/lv2specgen/lv2specgen.py
+++ b/lv2specgen/lv2specgen.py
@@ -976,7 +976,7 @@ def getInstances(model, classes, properties):
instances.append(getSubject(i))
return instances
-def load_tags(path, doc_base, doc_prefix):
+def load_tags(path, docdir):
"Build a (symbol => URI) map from a Doxygen tag file."
def getChildText(elt, tagname):
@@ -987,7 +987,7 @@ def load_tags(path, doc_base, doc_prefix):
return ''
def linkTo(sym, url):
- return '<span><a href="%s/%s">%s</a></span>' % (doc_base, url, sym)
+ return '<span><a href="%s/%s">%s</a></span>' % (docdir, url, sym)
tagdoc = xml.dom.minidom.parse(path)
root = tagdoc.documentElement
@@ -1001,7 +1001,7 @@ def load_tags(path, doc_base, doc_prefix):
name = getChildText(cn, 'name')
filename = getChildText(cn, 'filename')
- linkmap[name] = linkTo(name, doc_prefix + filename)
+ linkmap[name] = linkTo(name, filename)
prefix = ''
if cn.getAttribute('kind') != 'file':
@@ -1013,11 +1013,11 @@ def load_tags(path, doc_base, doc_prefix):
mafile = getChildText(m, 'anchorfile')
manchor = getChildText(m, 'anchor')
linkmap[mname] = linkTo(
- mname, '%s%s#%s' % (doc_prefix, mafile, manchor))
+ mname, '%s#%s' % (mafile, manchor))
return linkmap
-def specgen(specloc, indir, docdir, style_uri, doc_base, doc_prefix, tags, instances=False, mode="spec"):
+def specgen(specloc, indir, style_uri, docdir, tags, instances=False, mode="spec"):
"""The meat and potatoes: Everything starts here."""
global spec_url
@@ -1037,7 +1037,7 @@ def specgen(specloc, indir, docdir, style_uri, doc_base, doc_prefix, tags, insta
template = f.read()
# Load code documentation link map from tags file
- linkmap = load_tags(tags, doc_base, doc_prefix)
+ linkmap = load_tags(tags, docdir)
m = rdflib.ConjunctiveGraph()
manifest_path = os.path.join(os.path.dirname(specloc), 'manifest.ttl')
@@ -1236,14 +1236,13 @@ def getOntologyNS(m):
def usage():
script = os.path.basename(sys.argv[0])
- print("""Usage: %s ONTOLOGY INDIR STYLE OUTPUT BASE TAGS [FLAGS]
+ print("""Usage: %s ONTOLOGY INDIR STYLE OUTPUT DOCDIR TAGS [FLAGS]
ONTOLOGY : Path to ontology file
INDIR : Input directory containing template.html and style.css
STYLE : Stylesheet URI
OUTPUT : HTML output path
- DOCBASE : Documentation output base URI
- DOCPREFIX : Documentation link prefix
+ DOCDIR : Doxygen HTML directory
TAGS : Doxygen tags file
Optional flags:
@@ -1263,29 +1262,12 @@ if __name__ == "__main__":
if (len(args) < 3):
usage()
else:
-
- # Ontology
- specloc = "file:" + str(args[0])
-
- # Input directory
- indir = args[1]
-
- # Style
- style_uri = args[2]
-
- # Destination
- dest = args[3]
-
- # Doxygen documentation directory
- doc_base = args[4]
-
- # Documentation link prefix
- doc_prefix = args[5]
-
- # Doxygen tags file
- doc_tags = args[6]
-
- docdir = os.path.join(doc_base, 'ns', 'doc')
+ ontology = "file:" + str(args[0])
+ indir = args[1]
+ style = args[2]
+ output = args[3]
+ docdir = args[4]
+ tags = args[5]
# Flags
instances = False
@@ -1301,7 +1283,7 @@ if __name__ == "__main__":
i += 1
try:
- save(dest, specgen(specloc, indir, docdir, style_uri, doc_base, doc_prefix, tags, instances=instances))
+ save(output, specgen(specloc, indir, style, docdir, tags, instances=instances))
except:
e = sys.exc_info()[1]
print('error: ' + str(e))
diff --git a/wscript b/wscript
index 8f97d8f..72d99ff 100644
--- a/wscript
+++ b/wscript
@@ -143,10 +143,8 @@ def specgen(task):
specdoc = lv2specgen.specgen(
spec.abspath(),
SPECGENDIR,
- os.path.relpath('build/doc', bundle),
os.path.relpath(STYLEPATH, bundle),
- os.path.abspath('build'),
- 'doc/html/',
+ os.path.relpath('build/doc/html', bundle),
TAGFILE,
instances=True)