.--------------------------------------------------------------------- .- macros.def Various macro definitions .- .- Written: 97/06/02 Pieter Hintjens .- Revised: 98/05/08 Pieter Hintjens .--------------------------------------------------------------------- .- Macros for common HTML tags and constructions .macro TITLE $* .macro H1

$*

.macro H2

$*

.macro H3

$*

.macro H4

$*

.macro H5
$*
.macro H6
$*
.macro HREF $+ .macro THEAD - - {} - .macro TBODY {} .macro TFOOT
$n
$n
.macro IMAGE $+ .----------------------------------------------------------------------------- .- .- These macros come from the Xitami documentation where they're used to .- build FAQ tables. The FAQ_TABLE macro defines a FAQ section, like so: .- .- .FAQ_TABLE g General Questions .- .- I use a single letter prefix but you can use anything unique. This is .- used to name the anchors, which will be 'g_1', 'g_2', etc. for FAQs in .- this section. The FAQ macro defines one FAQ entry: .- .-

General Questions

.- .- .FAQ g How do you pronounce \'Xitami\'? .-

Just say 'iMatix' backwards -- it's simple! .- .- Note that quotes and apostrophes need to be escaped. .- .- These macros use anchors to count the number of questions in each .- section, then build a .for loop to output the FAQ tables. Since the .- tables must be built in the pass following the entries, the FAQ_TABLE .- macro propogates itself through to pass 2, after the FAQ macros have .- been processed. This may fail if you put the FAQ macros inside .if or .- .for loops. In that case you need to pass the document through htmlpp .- twice to resolve all the anchors. .- .- FAQ_TABLE also uses a small trick to skip the first argument so that it .- can use $+ for the table title. .- .macro FAQ - .define count_$1 = $\(count_$1?0) + 1 -


$+\ - .build anchor $1_$\(count_$1)=$+ - .build anchor last_$1=$\(count_$1) .macro FAQ_TABLE - .if $\(PASS) == 1 - .FAQ_TABLE $* - .else - .define skip $1 -

$+ -

- .endif