From 2e2516e181bb4ffbbe516a85ec9d672faa344f79 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 12 Dec 2015 11:37:27 -0800 Subject: 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. --- genman.txr | 7 +++++-- 1 file 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)   -@sec @title +@sec @title @ (end) @ (cat BODY "\n") @ (or) @@ -72,7 +75,7 @@ Content-type: text/html @ (some) @ (cases)
@num @rest -@ (bind TOC `
@num @rest`) +@ (bind TOC `
@num @rest`) @ (or) @(skip) @ (output :into TOC) -- cgit v1.2.3