summaryrefslogtreecommitdiffstats
path: root/genman.txr
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-12-12 11:37:27 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-12-12 11:37:27 -0800
commit2e2516e181bb4ffbbe516a85ec9d672faa344f79 (patch)
tree6e5b15eb729582087253babaccfb95cbb65633ae /genman.txr
parent78526477cd038bdaf47fff694c0c7637c4351954 (diff)
downloadtxr-2e2516e181bb4ffbbe516a85ec9d672faa344f79.tar.gz
txr-2e2516e181bb4ffbbe516a85ec9d672faa344f79.tar.bz2
txr-2e2516e181bb4ffbbe516a85ec9d672faa344f79.zip
HTML doc: jump back to TOC feature.
Section numbers are now hyperlinks which jump back to their respective table of contents entry. * genman.txr (toc-tag): New function. Generate link anchors into section titles. Generate name anchors in TOC.
Diffstat (limited to 'genman.txr')
-rw-r--r--genman.txr7
1 files changed, 5 insertions, 2 deletions
diff --git a/genman.txr b/genman.txr
index 1afbaff1..c81e18c0 100644
--- a/genman.txr
+++ b/genman.txr
@@ -22,6 +22,9 @@
(set [dupes h] title)
(format nil "N-~,08X" h)))
+ (defun toc-tag (sec)
+ `TOC-@sec`)
+
(set [tagmap "lbAB"] (hash-title "NAME"))
(defun enumerate (title)
@@ -49,7 +52,7 @@ Content-type: text/html
@ (do (set [tagmap tag] newtag))
@ (output :into BODY)
<A NAME="@newtag">&nbsp;</A>
-<H@level>@sec @title</H@level>
+<H@level><A HREF="#@(toc-tag sec)">@sec</A> @title</H@level>
@ (end)
@ (cat BODY "\n")
@ (or)
@@ -72,7 +75,7 @@ Content-type: text/html
@ (some)
@ (cases)
<DT><A HREF="#@tag">@num @rest
-@ (bind TOC `<DT>@num <A HREF="#@[tagmap tag]">@rest`)
+@ (bind TOC `<DT><A NAME="@(toc-tag num)">@num</A> <A HREF="#@[tagmap tag]">@rest`)
@ (or)
<A NAME="index">@(skip)
@ (output :into TOC)