.\" == Utility macros == .\" Sets the line length for the page .de LINE_LENGTH . nr LL \\$1 . ll \\n[LL]n .. .als LL LINE_LENGTH .\" Set the default line length .LL 64 . .\" .ds alias .\" Use it to set title and date .als SET ds . .\" Make it so all the output will end on the same "page", one .\" just long enough to contain it all. .de ADJUST . br . pl \\n[nl]u .. .de FIN . br . sp . nop # post - end . br . ADJUST .. .de INIT . pl 999999 . em FIN . blm PP . if d date .ds tmp \\*[date] . if d title \{\ . ie d tmp .ds tmp \\*[tmp] - \\*[title] . el .ds tmp \\*[title] . \} . if \\w|\\*[tmp]| .nop !\\*[tmp] . rm tmp .\" Check for the existence of the `nav' diversion - it should .\" contain navigation links, which we'll put at the top of the .\" page for now (putting them at the end would only require us .\" to mess around with `FIN') . if d nav \{\ . br . nop # nav - start . br . nav . nop # nav - end . br . nop # post - start . \} .. . .de SP . br . sp 1 .. . .\" == General formatting macros == .\" === Center text === .de CS . ce 9999 .. .de CE . ce 0 .. .\" === ASCII-art === .\" Pass `C' as the first argument to this .AS **and** wrap .\" the ASCII-art in `%&' to center it preserving whitespace. .de AS . ie |\\$1|C| .CS . br . ec % . nf .. .\" ASCII art end .de AE . fi . ec . CE . br .. .\" === Paragraphs === .\" Paragraph .de PP . in 0 . ti 0 . nh . ad l . SP .. .\" Hanging paragraph .de HP . PP . in +2n . ti -2n .. .\" === Unordered lists === .nr in-list 0 .de LS . br . if \\n[in-list]=0 .sp 1 . nr in-list +1 . in +3n .. .\" List end .de LE . in -3n . nr in-list -1 . br .. .\" List item .de LI . br . nop \\Z|\\h"-2n"-|\\c .. .\" === Section break === .de BR . br . ce 1 . nop - - - . br .. .\" === Horizontal rule === .de HR . br . nr i 0 1 . ds hr i- . while (\\n+[i]<\\n[LL]) .ds hr \\*[hr]- . nop \\*[hr]^^ . rm hr . br .. . .\" == Gophermap macros == .\" Troff apparently can't output a tab character, so the .\" .SELECTOR macro outputs two carets (`^^') instead. .\" This needs to be fixed after processing the file with troff, .\" but a simple .\" sed FILE -i -e 's/\^\^/\t/g' .\" is enough. .de SELECTOR . nf . ie \\n[.$]>3 .nop \\$1\\$3^^\\$2^^\\$4^^\\$5 . el .nop \\$1\\$3^^\\$2 . fi .. .de URL . SELECTOR h URL:\\$1 "\\$2" null.host 1 .. .de DIR . ds tmp \\$1 . shift . SELECTOR 1 \\*[tmp] "\\$*" . rm tmp .. .de NAV . da nav . nh . SELECTOR 1 \\$2 "\\$1" \!. br . br . di .. .\" BACK "files" /files would produce .\" 1Back to files /files .de BACK . NAV "Back to \\$1" "\\*[home]\\$2" .. .als BCK BACK .\" List item containing an URL .\" Use it as .\" .LI_URL "https://example.com" "Description" .de LI_URL . br . ti 0 . nf . nr li 1+((\\n[in-list]-1)*2) . nop h\\h"\\n[li]n"-\\0\\$2^^URL:\\$1 . fi .. .\" Headings .de H1 . SP . SELECTOR i - "== \\$* ==" null.host 1 .. .de H2 . SP . SELECTOR i - "=== \\$* ===" null.host 1 ..