From 74d75a7a6f3ea4bef5b4489c65e8a876ae480c76 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 29 Apr 2016 16:55:10 +0200 Subject: Update script that generates browsable hyperlinked html source. --- scripts/runtohtml.sh | 4 ++-- scripts/tohtml.py | 21 ++++++++++++--------- 2 files changed, 14 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/runtohtml.sh b/scripts/runtohtml.sh index cd1fee90..918eb652 100644 --- a/scripts/runtohtml.sh +++ b/scripts/runtohtml.sh @@ -2,7 +2,7 @@ rm -rf docs/browse -FILES=$(find include source platform -name '*.[ch]') +FILES=$(find include source platform -name '*.[chm]') echo running ctags to make xref ctags -x $FILES > tags-xref @@ -12,7 +12,7 @@ do output=docs/browse/$input.html mkdir -p $(dirname $output) echo $input $output - python scripts/tohtml.py < $input > $output + python scripts/tohtml.py $input < $input > $output done rm tags-xref diff --git a/scripts/tohtml.py b/scripts/tohtml.py index 3dd1c759..b6cb548e 100644 --- a/scripts/tohtml.py +++ b/scripts/tohtml.py @@ -1,19 +1,22 @@ import sys, os, re -HEADER=""" +HEADER=""" + + -
"""
+
+
"""
 
 FOOTER="""
""" -prefixes = [ 'fz_', 'pdf_', 'xps_', 'cbz_', 'pdfapp_' ] +prefixes = [ 'fz_', 'pdf_', 'xps_', 'cbz_', 'html_', 'epub_', 'svg_', 'ui_', 'pdfapp_' ] def is_public(s): for prefix in prefixes: @@ -21,19 +24,19 @@ def is_public(s): return True return False -def load_tags(): +def load_tags(curfile): tags = {} for line in open("tags-xref").readlines(): ident, type, line, file, text = line.split(None, 4) - if not is_public(ident): + if not is_public(ident) and file != curfile: continue - if type == 'function': + if type == 'function' or type == 'macro': tags[ident] = '%s' % ("/docs/browse/" + file, line, ident) - if type == 'typedef' or type == 'struct': + if type == 'typedef': tags[ident] = '%s' % ("/docs/browse/" + file, line, ident) return tags -tags = load_tags() +tags = load_tags(sys.argv[1]) def quote(s): return s.replace('&','&').replace('<','<').replace('>','>') -- cgit v1.2.3