diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-12-12 11:37:27 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-12-12 11:37:27 -0800 |
commit | 2e2516e181bb4ffbbe516a85ec9d672faa344f79 (patch) | |
tree | 6e5b15eb729582087253babaccfb95cbb65633ae /genman.txr | |
parent | 78526477cd038bdaf47fff694c0c7637c4351954 (diff) | |
download | txr-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.txr | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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"> </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) |