diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | genman.txr | 26 |
2 files changed, 31 insertions, 0 deletions
@@ -1,3 +1,8 @@ +2015-06-26 Kaz Kylheku <kaz@kylheku.com> + + * genman.txr: New filter to add hyperlinks within code in + more places such as examples and summary lists. + 2015-06-24 Kaz Kylheku <kaz@kylheku.com> * txr.1: partition example: wrong use of where function. @@ -93,6 +93,32 @@ This document was created by @1)) BODY LOOKUP)) +@(set BODY @(let ((inside-tt nil) + (inside-syntax nil)) + (mapcar (do cond + ((equal @1 "<TT>") (set inside-tt t) @1) + ((equal @1 "</TT>") (set inside-tt nil) + (set inside-syntax nil) + @1) + ((equal @1 "<DT>Syntax:<DD>") (set inside-syntax t) @1) + ((or (and inside-tt (not inside-syntax)) + (match-regex @1 #/<DT><TT>/)) + (let* ((out0 (regsub #/@\([a-z0-9\-]+/ + (do let* ((tok [@1 2..:]) + (tag (or [txlhash tok] + [@@2 tok]))) + (if tag + `@[@1 0](<A HREF="#@tag">@tok</A>` + @1)) @1))) + (regsub #/[\(\[][^ )&]+/ + (do let* ((tok [@1 1..:]) + (tag [txlhash tok])) + (if tag + `(<A HREF="#@tag">@tok</A>` + @1)) out0))) + (t @1)) + BODY + LOOKUP))) @(output) <HTML> <HEAD><TITLE>Manpage for TXR @VERSION</TITLE> |