From bfcdcde2b9a5c20688fe73a841c288218acd975d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 27 Apr 2019 15:09:18 +0200 Subject: 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 instead of . --- lv2specgen/lv2specgen.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'lv2specgen') 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 = '%s' % ( b, target, name) @@ -1182,7 +1180,6 @@ def writeIndex(model, specloc, index_path, root_path, root_uri): row += '' - # 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( -- cgit v1.2.1