aboutsummaryrefslogtreecommitdiffstats
path: root/lv2specgen
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-04-27 15:09:18 +0200
committerDavid Robillard <d@drobilla.net>2019-04-27 17:20:53 +0200
commitbfcdcde2b9a5c20688fe73a841c288218acd975d (patch)
treea9468bceb2adfb9bb2af13a08a512e84c5cbc61e /lv2specgen
parent0d5b9864429edf34575b066b4a2d8988b8b8e302 (diff)
downloadlv2-bfcdcde2b9a5c20688fe73a841c288218acd975d.tar.xz
Flatten documentation to fix fragment links
This removes all the extra bundle content from the documentation output and instead makes pages directly at the URI of specifications. This way, links to fragments in spec pages (which are often copy and pasted) are correct fragment identifiers like <http://lv2plug.in/ns/lv2core#Plugin> instead of <http://lv2plug.in/ns/lv2core/#Plugin>.
Diffstat (limited to 'lv2specgen')
-rwxr-xr-xlv2specgen/lv2specgen.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py
index 2f2a7d8..ce05c74 100755
--- a/lv2specgen/lv2specgen.py
+++ b/lv2specgen/lv2specgen.py
@@ -1142,15 +1142,13 @@ def writeIndex(model, specloc, index_path, root_path, root_uri):
# Find relative link target
if root_uri and ext_node.startswith(root_uri):
- target = ext_node[len(root_uri):]
+ target = ext_node[len(root_uri):] + '.html'
else:
- target = os.path.relpath(ext_node, root_path)
+ target = os.path.relpath(ext_node, root_path) + '.html'
stem = os.path.splitext(os.path.basename(target))[0]
# Specification (comment is to act as a sort key)
- if not options.online_docs:
- target += '/' + stem + '.html'
row = '<tr><!-- %s --><td><a rel="rdfs:seeAlso" href="%s">%s</a></td>' % (
b, target, name)
@@ -1182,7 +1180,6 @@ def writeIndex(model, specloc, index_path, root_path, root_uri):
row += '</tr>'
- # index = open(os.path.join(out, 'index_rows', b), 'w')
index = open(index_path, 'w')
index.write(row)
index.close()
@@ -1453,8 +1450,6 @@ if __name__ == "__main__":
help='Document instances')
opt.add_option('--copy-style', action='store_true', dest='copy_style',
help='Copy style from template directory to output directory')
- opt.add_option('--online', action='store_true', dest='online_docs',
- help='Generate online documentation')
(options, args) = opt.parse_args()
opts = vars(options)
@@ -1485,9 +1480,7 @@ if __name__ == "__main__":
# Root link
root_path = opts['root_path']
root_uri = opts['root_uri']
- root_link = root_path
- if not options.online_docs:
- root_link = os.path.join(root_path, 'index.html')
+ root_link = os.path.join(root_path, 'index.html')
# Generate spec documentation
specdoc = specgen(