summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2013-08-19 15:14:40 +0200
committerTor Andersson <tor.andersson@artifex.com>2013-08-21 13:54:55 +0200
commitc8c5e2205b80f79590af55e91776085b5acd0490 (patch)
tree22f4a95e7aee03dccc740749e30eb0a8b736386e /scripts
parentaca66f040b72397203c3eb3d8a9ff893d4c1424c (diff)
downloadmupdf-c8c5e2205b80f79590af55e91776085b5acd0490.tar.xz
Update source code browser html generation scripts for new layout.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/runtohtml.sh8
-rw-r--r--scripts/tohtml.py6
2 files changed, 7 insertions, 7 deletions
diff --git a/scripts/runtohtml.sh b/scripts/runtohtml.sh
index 9b94e22b..cd1fee90 100644
--- a/scripts/runtohtml.sh
+++ b/scripts/runtohtml.sh
@@ -1,16 +1,16 @@
#!/bin/bash
-mkdir -p doc/source
-rm doc/source/*.html
+rm -rf docs/browse
-FILES="fitz/*.[ch] draw/*.[ch] pdf/*.[ch] xps/*.[ch] cbz/*.[ch] apps/*.[ch]"
+FILES=$(find include source platform -name '*.[ch]')
echo running ctags to make xref
ctags -x $FILES > tags-xref
for input in $FILES
do
- output=doc/source/$(basename $input).html
+ output=docs/browse/$input.html
+ mkdir -p $(dirname $output)
echo $input $output
python scripts/tohtml.py < $input > $output
done
diff --git a/scripts/tohtml.py b/scripts/tohtml.py
index 6ad22ecd..3dd1c759 100644
--- a/scripts/tohtml.py
+++ b/scripts/tohtml.py
@@ -28,9 +28,9 @@ def load_tags():
if not is_public(ident):
continue
if type == 'function':
- tags[ident] = '<a class="function" href="%s#%s">%s</a>' % (os.path.basename(file), line, ident)
+ tags[ident] = '<a class="function" href="%s#%s">%s</a>' % ("/docs/browse/" + file, line, ident)
if type == 'typedef' or type == 'struct':
- tags[ident] = '<a class="typedef" href="%s#%s">%s</a>' % (os.path.basename(file), line, ident)
+ tags[ident] = '<a class="typedef" href="%s#%s">%s</a>' % ("/docs/browse/" + file, line, ident)
return tags
tags = load_tags()
@@ -48,7 +48,7 @@ for line in sys.stdin.readlines():
line = line.replace("/*", '<span class="comment">/*')
line = line.replace("*/", '*/</span>')
- line = re.sub('^#include "([a-z-]*\.h)"', '#include "<a href="\\1">\\1</a>"', line)
+ line = re.sub('^#include "([a-z-/]*\.h)"', '#include "<a href="/docs/browse/include/\\1">\\1</a>"', line)
# find identifiers and hyperlink to their definitions
words = re.split("(\W+)", line)