@# This requires a hacked version of man2html @# See here: http://www.kylheku.com/cgit/man @(bind closedtxt " [+]") @(bind opentxt " [-]") @(bind xpnall "[expand all]") @(bind clpsall "[collapse all]") @(bind closed t) @(do (defvarl symhash (hash)) (defvarl tagmap (hash)) (defvarl tochash (hash)) (defvarl dupe-hashes (hash)) (defvarl dupe-titles (hash)) (defvarl direct (hash)) (defvarl disamb (hash)) (defvarl dist-counter 0) (defvarl colli (hash-props)) (defun hash-title (title) (let* ((ti title) (cntr 0) (defs (build (while-match `@nil@ttitem@rest` ti (add ttitem) (set ti rest))))) (set title (if defs (car defs) (downcase-str title)) ti title) (while* [dupe-titles title] (set title `T-@(inc cntr)-@ti`)) (set [dupe-titles title] t) (let* ((h (crc32 title)) (h (+ h (or [colli title] 0))) (existing [dupe-hashes h])) (when existing (unless (equal title existing) (error "~a ~a hash collision!" existing title))) (set [dupe-hashes h] title) (format nil "N-~,08X" h)))) (defun toc-tag (sec) `TOC-@sec`) (defun process-ambiguities (hash) (let ((rhash (hash))) (dohash (sym tags hash) (let ((shash (fmt "S-~,08X" (crc32 sym)))) (if [rhash shash] (error "~a ~a hash collision" sym [rhash shash]) (set [rhash shash] sym)) (set [hash sym] shash) (if (null (cdr tags)) (push shash [direct (car tags)]) (set [disamb shash] (reverse tags)))))))) Content-type: text/html @(skip 15)

TXR

@(skip)Updated: @YEAR-@MONTH-@DAY
Index @(bind TIME @(make-time-utc (int-str YEAR) (int-str MONTH) (int-str DAY) 0 0 0 nil)) @(bind VERSION nil) @(collect :vars (BODY)) @ (some) @ (cases)   @ (some) @sec @title @ (or) @sec @title @ (end) @ (bind newtag @(hash-title title)) @ (do (set [tagmap tag] newtag)) @ (output :into BODY)   @sec @title @ (end) @ (cat BODY "\n") @ (or) @BODY @ (end) @ (and) TXR - text processing language (version @ver) @ (set VERSION ver) @ (end) @(until)
 

Index

@(end)
@(collect :vars (TOC)) @ (some) @ (cases) @ (cases)
@num @rest
@ (or)
@num @rest
@ (end) @ (bind TOC `
@num @rest
`) @ (or) @(skip) @ (output :into TOC)

Contents

@xpnall @ (end) @ (or) @TOC @ (end) @ (and)
@nil TXR LISP
@ (and)
@(coll :vars (sym))@sym@(end) @ (do (let ((n-tag [tagmap tag])) (mapdo (do pushnew n-tag [symhash (html-decode @1)]) sym) (set [tochash n-tag] rest))) @ (and)
@num @nil @ (maybe)
@ (end)
@ (cat TOC) @ (bind pos @(car (search-regex TOC #/<\/dt/))) @ (bind id @(gensym)) @ (do (set [TOC pos..pos] `@(if closed closedtxt opentxt)`)) @ (output :into TOC) @TOC
@ (end) @ (end) @(until) This document was created by @(end) @(flatten TOC) @(do (process-ambiguities symhash)) @(set BODY @(let ((inside-tt nil) (inside-syntax nil)) (mapcar (do cond ((equal @1 "") (set inside-tt t) @1) ((equal @1 "") (set inside-tt nil) (set inside-syntax nil) @1) ((equal @1 "
Syntax:
") (set inside-syntax t) @1) ((or (and inside-tt (not inside-syntax)) (match-regex @1 #/
/)) (regsub #/@?[\(\[][^ )&]+/ (do let* ((at (if (eql [@1 0] #\@) (pop @1))) (tok [@1 1..:]) (bkt [@1 0]) (tag [symhash (html-decode tok)])) (if tag `@at@bkt@tok` `@at@1`)) @1)) ((starts-with "@rest` shash [direct tag]) @1 (join (collect-each ((sh shash)) ` \n`) @1))) ((search-regex @1 #//) @1) (t (regsub #/.%<\/tt>/ (do let* ((tok [@1 4 -5]) (tend (break-str tok ") ")) pfx sym sfx tag) (cond ((match-str tok "@(") (set pfx "@(" sym [tok 2 tend] sfx [tok tend .. :] tag [symhash (html-decode sym)])) (t (set tag [symhash (html-decode tok)] sym tok))) (if tag `@pfx@sym@sfx` @1)) @1))) BODY))) @(bind (d-tag n-tag) @(transpose (hash-pairs disamb))) @(output) Manpage for TXR @VERSION

Manpage for TXR @VERSION

@(time-string-utc TIME "%b %d, %Y")

@(repeat) @TOC @(end)
@(repeat) @BODY @(first) @(end) @(end) @(do (let ((ignames '("*-1" "*-2" "*-20" "*0" "*1" "*2" "*99" "*n" "*r" "*v" "--args" "--eargs" "-C" ".." "TXR_COMPAT" "buf-get-" "buf-put-")) (imgsyms (hash-list (append-each* ((entry [remove-if (op equal "pub") (package-alist) car]) (pkg-name [mapcar car entry]) (pkg [mapcar cdr entry])) (let ((fn (casequal pkg-name (("usr" "keyword") (fun tostringp)) (t (opip tostringp (join-with ":" pkg-name)))))) (mapcar fn (package-symbols pkg))))))) (each ((sym ignames)) (del [symhash sym])) (let ((missing (hash-diff symhash imgsyms))) (dohash (sym val missing) (format *stderr* "~a: missing from image\n" sym)))))