Minimal support for <LINK REL="next"> etc machine-readable navigation links.
[sgt/halibut] / doc / output.but
CommitLineData
0929484e 1\versionid $Id$
2
16ea3abe 3\C{output} Halibut output formats
4
339cbe09 5This chapter describes each of Halibut's current \i{output formats}.
6It gives some general information about the format, and also
7describes all the \i{configuration directives} which are specific to
8that format.
16ea3abe 9
10\H{output-text} Plain text
11
339cbe09 12This output format generates the document as a single \i{plain text}
9ec43d08 13file. No table of contents or index is generated.
16ea3abe 14
16ea3abe 15The precise formatting of the text file can be controlled by a
16variety of configuration directives. They are listed in the
17following subsections.
18
0a6347b4 19\S{output-text-file} Output file name
20
21\dt \I{\cw{\\cfg\{text-filename\}}}\cw{\\cfg\{text-filename\}\{}\e{filename}\cw{\}}
22
23\dd Sets the \i{output file name} in which to store the text file.
24This directive is implicitly generated if you provide a file name
25parameter after the command-line option \i\c{--text} (see
26\k{running-options}).
27
16ea3abe 28\S{output-text-dimensions} Indentation and line width
29
30This section describes the configuration directives which control
339cbe09 31the \i{horizontal dimensions} of the output text file: how much
16ea3abe 32paragraphs are indented by and how long the lines are.
33
339cbe09 34\dt \I{\cw{\\cfg\{text-width\}}}\cw{\\cfg\{text-width\}\{}\e{width}\cw{\}}
16ea3abe 35
339cbe09 36\dd Sets the \I{text width}width of the main part of the document,
37in characters. This width will be used for wrapping paragraphs and
38for centring titles (if you have asked for titles to be centred -
39see \k{output-text-headings}). This width does \e{not} include the
40left indentation set by \cw{\\cfg\{text-indent\}}; if you specify an
16ea3abe 41indent of 8 and a width of 64, your maximum output line length will
42be 72.
43
339cbe09 44\dt \I{\cw{\\cfg\{text-indent\}}}\cw{\\cfg\{text-indent\}\{}\e{indent}\cw{\}}
16ea3abe 45
339cbe09 46\dd Sets the left \i{indentation} for the document. If you set this
47to zero, your document will look like an ordinary text file as
48someone with a text editor might have written it; if you set it
49above zero, the text file will have a \i{margin} down the left in
50the style of some printed manuals, and you can then configure the
51section numbers to appear in this margin (see
52\k{output-text-headings}).
16ea3abe 53
339cbe09 54\dt \I{\cw{\\cfg\{text-indent-code\}}}\cw{\\cfg\{text-indent-code\}\{}\e{indent}\cw{\}}
16ea3abe 55
56\dd Specifies how many extra characters of indentation (on top of
339cbe09 57the normal left indent) should be given to \I{code paragraphs,
58indentation} code paragraphs.
16ea3abe 59
339cbe09 60\dt \I{\cw{\\cfg\{text-list-indent\}}}\cw{\\cfg\{text-list-indent\}\{}\e{indent}\cw{\}}
16ea3abe 61
62\dd Specifies how many extra spaces should be used to indent the
339cbe09 63bullet or number in a \I{bulletted list, indentation}bulletted or
64\I{numbered list, indentation}numbered \I{list, indentation}list.
65The actual body of the list item will be indented by this much
66\e{plus} the value configured by \cw{\\cfg\{text-listitem-indent\}}.
16ea3abe 67
339cbe09 68\dt \I{\cw{\\cfg\{text-listitem-indent\}}}\cw{\\cfg\{text-listitem-indent\}\{}\e{indent}\cw{\}}
16ea3abe 69
70\dd Specifies how many extra spaces should be used to indent the
71body of a list item, over and above the number configured in
72\cw{\\cfg\{text-list-indent\}}.
73
339cbe09 74\dt \I{\cw{\\cfg\{text-indent-preamble\}}}\cw{\\cfg\{text-indent-preamble\}\{}\e{boolean}\cw{\}}
16ea3abe 75
339cbe09 76\dd When this is set to \c{true}, the document \i{preamble} (i.e. any
16ea3abe 77paragraphs appearing before the first chapter heading) will be
78indented to the level specified by \cw{\\cfg\{text-indent\}}. If
79this setting is \c{false}, the document preamble will not be
80indented at all from the left margin.
81
339cbe09 82\S{output-text-headings} \ii{Configuring heading display}
16ea3abe 83
84The directives in this section allow you to configure the appearance
85of the title, chapter and section headings in your text file.
86
339cbe09 87Several of the directives listed below specify the \i{alignment} of
88a heading. These alignment options have three possible values:
16ea3abe 89
339cbe09 90\dt \i\c{left}
16ea3abe 91
92\dd Align the heading to the very left of the text file (column zero).
93
339cbe09 94\dt \i\c{leftplus}
16ea3abe 95
96\dd Align the section title to the left of the main display region
97(in other words, indented to the level specified by
98\cw{\\cfg\{text-indent\}}). The section \e{number} is placed to the
99left of that (so that it goes in the margin if there is room).
100
339cbe09 101\dt \i\c{centre}
16ea3abe 102
103\dd Centre the heading.
104
105Also, several of the directives below specify how a title should be
339cbe09 106\I{underlining}underlined. The parameter to one of these directives
db662ca1 107should be either blank (\cw{\{\}}) or a piece of text which will be
108repeated to produce the underline. So you might want to specify, for
109example, \cw{\\text-title-underline\{=\}} but
110\cw{\\text-chapter-underline\{\-\}}.
111
112You can also specify more than one underline setting, and Halibut
113will choose the first one that the output character set supports.
114So, for example, you could write
65f95f6c 115\cw{\\text-chapter-underline\{\\u203e\}\{\-\}}, and Halibut would use
db662ca1 116the Unicode \q{OVERLINE} character where possible and fall back to
117the ASCII minus sign otherwise.
16ea3abe 118
339cbe09 119\dt \I{\cw{\\cfg\{text-title-align\}}}\cw{\\cfg\{text-title-align\}\{}\e{alignment}\cw{\}}
16ea3abe 120
121\dd Specifies the alignment of the overall document title: \c{left},
122\c{leftplus} or \c{centre}.
123
bdc961c7 124\dt \I{\cw{\\cfg\{text-title-underline\}}}\cw{\\cfg\{text-title-underline\}\{}\e{underline-text}\cw{\}}
16ea3abe 125
126\dd Specifies how the overall document title should be underlined.
127
339cbe09 128\dt \I{\cw{\\cfg\{text-chapter-align\}}}\cw{\\cfg\{text-chapter-align\}\{}\e{alignment}\cw{\}}
16ea3abe 129
130\dd Specifies the alignment of chapter and appendix headings.
131
bdc961c7 132\dt \I{\cw{\\cfg\{text-chapter-underline\}}}\cw{\\cfg\{text-chapter-underline\}\{}\e{underline-text}\cw{\}}
16ea3abe 133
134\dd Specifies how chapter and appendix headings should be underlined.
135
339cbe09 136\dt \I{\cw{\\cfg\{text-chapter-numeric\}}}\cw{\\cfg\{text-chapter-numeric\}\{}\e{boolean}\cw{\}}
16ea3abe 137
138\dd If this is set to \c{true}, then chapter headings will not
139contain the word \q{Chapter} (or whatever other word you have
140defined in its place - see \k{input-sections} and \k{input-config});
141they will just contain the chapter \e{number}, followed by the
142chapter title. If you set this to \c{false}, chapter headings will
143be prefixed by \q{Chapter} or equivalent.
144
339cbe09 145\dt \I{\cw{\\cfg\{text-chapter-suffix\}}}\cw{\\cfg\{text-chapter-suffix\}\{}\e{text}\cw{\}}
16ea3abe 146
147\dd This specifies the suffix text to be appended to the chapter
148number, before displaying the chapter title. For example, if you set
b7747050 149this to \cq{:\_}, then the chapter title might look something
16ea3abe 150like \q{Chapter 2: Doing Things}.
151
339cbe09 152\dt \I{\cw{\\cfg\{text-section-align\}}}\cw{\\cfg\{text-section-align\}\{}\e{level}\cw{\}\{}\e{alignment}\cw{\}}
16ea3abe 153
154\dd Specifies the alignment of section headings at a particular
155level. The \e{level} parameter specifies which level of section
156headings you want to affect: 0 means first-level headings (\c{\\H}),
1571 means second-level headings (\c{\\S}), 2 means the level below
158that (\c{\\S2}), and so on. The \e{alignment} parameter is treated
159just like the other alignment directives listed above.
160
bdc961c7 161\dt \I{\cw{\\cfg\{text-section-underline\}}}\cw{\\cfg\{text-section-underline\}\{}\e{level}\cw{\}\{}\e{underline-text}\cw{\}}
16ea3abe 162
163\dd Specifies how to underline section headings at a particular level.
164
339cbe09 165\dt \I{\cw{\\cfg\{text-section-numeric\}}}\cw{\\cfg\{text-section-numeric\}\{}\e{level}\cw{\}\{}\e{boolean}\cw{\}}
16ea3abe 166
167\dd Specifies whether section headings at a particular level should
168contain the word \q{Section} or equivalent (if \c{false}), or should
169be numeric only (if \c{true}).
170
339cbe09 171\dt \I{\cw{\\cfg\{text-section-suffix\}}}\cw{\\cfg\{text-section-suffix\}\{}\e{level}\cw{\}\{}\e{text}\cw{\}}
16ea3abe 172
339cbe09 173\dd Specifies the \I{suffix text, in section titles}suffix text to
174be appended to section numbers at a particular level, before
175displaying the section title.
16ea3abe 176
db662ca1 177\S{output-text-characters} Configuring the characters used
178
6b4dfd74 179\dt \I\cw{\\cfg\{text-charset\}}\cw{\\cfg\{text-charset\}\{}\e{character set name}\cw{\}}
180
181\dd This tells Halibut what \i{character set} the output should be
182in. Any Unicode characters representable in this set will be output
183verbatim; any other characters will not be output and their
184\i{fallback text} (if any) will be used instead.
185
186\lcont{
187
188The character set names are the same as for
189\cw{\\cfg\{input-charset\}} (see \k{input-config}). However, unlike
190\cw{\\cfg\{input-charset\}}, this directive affects the \e{entire}
191output; it's not possible to switch encodings halfway through.
192
193}
194
db662ca1 195\dt \I{\cw{\\cfg\{text-bullet\}}}\cw{\\cfg\{text-bullet\}\{}\e{text}\cw{\}}[\cw{\{}\e{text}...\cw{\}}]
196
197\dd This specifies the text which should be used as the \i{bullet}
198in bulletted lists. It can be one character
199(\cw{\\cfg\{text-bullet\}\{-\}}), or more than one
200(\cw{\\cfg\{text-bullet\}\{(*)\}}).
201
202\lcont{
203
6069815a 204Like \cw{\\cfg\{quotes\}} (see \k{input-config}), you can specify multiple
205possible options after this command, and Halibut will choose the first one
206which the output character set supports. For example, you might write
db662ca1 207\cw{\\cfg\{text-bullet\}\{\\u2022\}\{\\u00b7\}\{*\}}, in which case
208Halibut would use the Unicode \q{BULLET} character where possible,
209fall back to the ISO-8859-1 \q{MIDDLE DOT} if that wasn't available,
210and resort to the ASCII asterisk if all else failed.
211
212}
213
214\dt \I{\cw{\\cfg\{text-rule\}}}\cw{\\cfg\{text-rule\}\{}\e{text}\cw{\}}[\cw{\{}\e{text}...\cw{\}}]
215
216\dd This specifies the text which should be used for drawing
217\i{horizontal rules} (generated by \i\c{\\rule}; see
218\k{input-rule}). It can be one character, or more than one. The
219string you specify will be repeated to reach the required width, so
b7747050 220you can specify something like \cq{-=} to get a rule that looks
db662ca1 221like \cw{-=-=-=}.
222
223\lcont{
224
225Like \cw{\\cfg\{text-bullet\}}, you can specify multiple fallback
226options in this command.
227
228}
229
230\dt \I{\cw{\\cfg\{text-quotes\}}}\cw{\\cfg\{text-quotes\}\{}\e{open-quote}\cw{\}\{}\e{close-quote}\cw{\}}[\cw{\{}\e{open-quote}\cw{\}\{}\e{close-quote}...\cw{\}}]
231
6069815a 232\dd This specifies a set of quote characters for the text backend,
233overriding any defined by \cw{\\cfg\{quotes\}}. It has the same syntax
234(see \k{input-config}).
db662ca1 235
236\lcont{
237
6069815a 238In this backend, these quotes will also be used to mark text enclosed
239in the \c{\\c} command (see \k{input-code}).
db662ca1 240
241}
242
243\dt \I{\cw{\\cfg\{text-emphasis\}}}\cw{\\cfg\{text-emphasis\}\{}\e{start-emph}\cw{\}\{}\e{end-emph}\cw{\}}[\cw{\{}\e{start-emph}\cw{\}\{}\e{end-emph}...\cw{\}}]
244
5b1d0032 245\dd This specifies the characters which should be used to surround
db662ca1 246emphasised text (written using the \c{\\e} command; see
247\k{input-emph}).
248
249\lcont{
250
251You should separately specify the start-emphasis and end-emphasis
252text, each of which can be more than one character if you want.
253Also, like \cw{\\cfg\{text-quotes\}}, you can specify multiple pairs
254of fallback options in this command, and Halibut will always use a
255matching pair.
256
257}
258
16ea3abe 259\S{output-text-misc} Miscellaneous configuration options
260
db662ca1 261\dt \I{\cw{\\cfg\{text-list-suffix\}}}\cw{\\cfg\{text-list-suffix\}\{}\e{text}\cw{\}}
262
263\dd This text is appended to the number on a \i{numbered list} item
264(see \k{input-list-number}). So if you want to label your lists as
265\q{1)}, \q{2)} and so on, then you would write
266\cw{\\cfg\{text-list-suffix\}\{)\}}.
267
339cbe09 268\dt \I{\cw{\\cfg\{text-versionid\}}}\cw{\\cfg\{text-versionid\}\{}\e{boolean}\cw{\}}
16ea3abe 269
339cbe09 270\dd If this is set to \c{true}, \i{version ID paragraphs} (defined
271using the \i\c{\\versionid} command - see \k{input-blurb}) will be
272included at the bottom of the text file. If it is set to \c{false},
273they will be omitted completely.
16ea3abe 274
16ea3abe 275\# FIXME: code indentation is configurable, therefore \quote
276\# indentation probably ought to be as well.
277
278\# FIXME: text-indent-* should be consistently named.
279
280\S{output-text-defaults} Default settings
281
339cbe09 282The \i{default settings} for Halibut's plain text output format are:
16ea3abe 283
0a6347b4 284\c \cfg{text-filename}{output.txt}
285\c
16ea3abe 286\c \cfg{text-width}{68}
287\c \cfg{text-indent}{7}
288\c \cfg{text-indent-code}{2}
289\c \cfg{text-list-indent}{1}
290\c \cfg{text-listitem-indent}{3}
291\c \cfg{text-indent-preamble}{false}
292\c
293\c \cfg{text-title-align}{centre}
db662ca1 294\c \cfg{text-title-underline}{\u2550}{=}
16ea3abe 295\c
296\c \cfg{text-chapter-align}{left}
db662ca1 297\c \cfg{text-chapter-underline}{\u203e}{-}
16ea3abe 298\c \cfg{text-chapter-numeric}{false}
299\c \cfg{text-chapter-suffix}{: }
300\c
301\c \cfg{text-section-align}{0}{leftplus}
302\c \cfg{text-section-underline}{0}{}
303\c \cfg{text-section-numeric}{0}{true}
304\c \cfg{text-section-suffix}{0}{ }
305\c
306\c \cfg{text-section-align}{1}{leftplus}
307\c \cfg{text-section-underline}{1}{}
308\c \cfg{text-section-numeric}{1}{true}
309\c \cfg{text-section-suffix}{1}{ }
310\c
311\c ... and so on for all section levels below this ...
312\e iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
db662ca1 313\c
6b4dfd74 314\c \cfg{text-charset}{ASCII}
db662ca1 315\c \cfg{text-bullet}{\u2022}{-}
316\c \cfg{text-rule}{\u2500}{-}
317\c \cfg{text-quotes}{\u2018}{\u2019}{`}{'}
318\c \cfg{text-emphasis}{_}{_}
319\c
320\c \cfg{text-list-suffix}{.}
321\c \cfg{text-versionid}{true}
16ea3abe 322
323\H{output-html} HTML
324
339cbe09 325This output format generates an \i{HTML} version of the document. By
16ea3abe 326default, this will be in multiple files, starting with
327\c{Contents.html} and splitting the document into files by chapter
328and/or subsection. You can configure precisely how the text is split
329between HTML files using the configuration commands described in
330this section. In particular, you can configure Halibut to output one
0a6347b4 331single HTML file instead of multiple ones.
16ea3abe 332
cb0b173d 333\I{\cw{\\cfg\{xhtml-anything\}}}Configuration directives with an
334\c{xhtml-} prefix are synonyms for those with an \c{html-} prefix.
16ea3abe 335
0a6347b4 336\S{output-html-file} Controlling the output file names
337
cb0b173d 338\dt \I{\cw{\\cfg\{html-contents-filename\}}}\cw{\\cfg\{html-contents-filename\}\{}\e{filename}\cw{\}}
0a6347b4 339
340\dd Sets the \i{output file name} in which to store the top-level
341contents page. Since this is the first page a user ought to see when
342beginning to read the document, a good choice in many cases might be
fc8e7adb 343\c{index.html} (although this is not the default, for historical
0a6347b4 344reasons).
345
cb0b173d 346\dt \I{\cw{\\cfg\{html-index-filename\}}}\cw{\\cfg\{html-index-filename\}\{}\e{filename}\cw{\}}
0a6347b4 347
348\dd Sets the file name in which to store the document's index.
349
cb0b173d 350\dt \I{\cw{\\cfg\{html-template-filename\}}}\cw{\\cfg\{html-template-filename\}\{}\e{template}\cw{\}}
0a6347b4 351
352\dd Provides a \i{template} to be used when constructing the file
353names of each chapter or section of the document. This template
354should contain at least one \i\e{formatting command}, in the form of
355a per cent sign followed by a letter. (If you need a literal per
356cent sign, you can write \c{%%}.)
357
358\lcont{
359
360The formatting commands used in this template are:
361
da090173 362\dt \I{%N-upper}\c{%N}
0a6347b4 363
364\dd Expands to the visible title of the section, with white space
b7747050 365removed. So in a chapter declared as \cq{\\C\{fish\} Catching
366Fish}, this formatting command would expand to
367\cq{CatchingFish}.
0a6347b4 368
369\dt \i\c{%n}
370
371\dd Expands to the type and number of the section, without white
b7747050 372space. So in chapter 1 this would expand to \cq{Chapter1}; in
373section A.4.3 it would expand to \cq{SectionA.4.3}, and so on.
0a6347b4 374If the section has no number (an unnumbered chapter created using
375\c{\\U}), this directive falls back to doing the same thing as
376\c{%N}.
377
378\dt \i\c{%b}
379
cb0b173d 380\dd Expands to the number of the section, in a format suitable for an
381HTML fragment name. The first character of the section type is
382prepended to the section number. So in chapter 1 this would expand to
383\cq{C1}; in section A.4.3 it would expand to \cq{SA.4.3}, and so on.
384If the section has no number (an unnumbered chapter created using
385\c{\\U}), this directive falls back to doing the same thing as \c{%N}.
0a6347b4 386
387\dt \i\c{%k}
388
389\dd Expands to the internal keyword specified in the section title.
b7747050 390So in a chapter declared as \cq{\\C\{fish\} Catching Fish}, this
391formatting command would expand to \cq{fish}. If the section has
0a6347b4 392no keyword (an unnumbered chapter created using \c{\\U}), this
393directive falls back to doing the same thing as \c{%N}.
394
395These formatting directives can also be used in the
cb0b173d 396\cw{\\cfg\{html-template-fragment\}} configuration directive (see
0a6347b4 397\k{output-html-misc}).
398
399}
400
cb0b173d 401\dt \I{\cw{\\cfg\{html-single-filename\}}}\cw{\\cfg\{html-single-filename\}\{}\e{filename}\cw{\}}
0a6347b4 402
403\dd Sets the file name in which to store the entire document, if
cb0b173d 404Halibut is configured (using \c{\\cfg\{html-leaf-level\}\{0\}} to
0a6347b4 405produce a single self-contained file. Both this directive \e{and}
cb0b173d 406\c{\\cfg\{html-leaf-level\}\{0\}} are implicitly generated if you
0a6347b4 407provide a file name parameter after the command-line option
408\i\c{--html} (see \k{running-options}).
409
16ea3abe 410\S{output-html-split} Controlling the splitting into HTML files
411
412By default, the HTML output from Halibut is split into multiple
413files. Each file typically contains a single chapter or section and
414everything below it, unless subsections of that chapter are
415themselves split off into further files.
416
417Most files also contain a contents section, giving hyperlinks to the
418sections in the file and/or the sections below it.
419
420The configuration directives listed below allow you to configure the
421splitting into files, and the details of the contents sections.
422
cb0b173d 423\dt \I{\cw{\\cfg\{html-leaf-level\}}}\cw{\\cfg\{html-leaf-level\}\{}\e{depth}\cw{\}}
16ea3abe 424
425\dd This setting indicates the depth of section which should be
339cbe09 426given a \I{leaf file}\q{leaf} file (a file with no sub-files). So if
427you set it to 1, for example, then every chapter will be given its
428own HTML file, plus a top-level \i{contents file}. If you set this
429to 2, then each chapter \e{and} each \c{\\H} section will have a
430file, and the chapter files will mostly just contain links to their
431\i{sub-file}s.
16ea3abe 432
433\lcont{
434
435If you set this option to zero, then the whole document will appear
436in a single file. If you do this, Halibut will call that file
cb0b173d 437\i\c{Manual.html} instead of \i\c{Contents.html} by default.
16ea3abe 438
0a6347b4 439This option is automatically set to zero if you provide a file name
440parameter after the command-line option \i\c{--html} (see
441\k{running-options}), because you have specified a single file name
442and so Halibut assumes you want the whole document to be placed in
443that file.
444
f2ef00b5 445You can also specify the special name \c{infinity} (or \c{infinite}
446or \c{inf}) if you want to ensure that \e{every} section and
447subsection ends up in a separate file no matter how deep you go.
448
16ea3abe 449}
450
cb0b173d 451\dt \I{\cw{\\cfg\{html-contents-depth\}}}\cw{\\cfg\{html-contents-depth\}\{}\e{level}\cw{\}\{}\e{depth}\cw{\}}
16ea3abe 452
339cbe09 453\dd This directive allows you to specify how \I{depth of
cb0b173d 454contents}deep any contents section in a particular level of file
455should go.
16ea3abe 456
457\lcont{
458
459The \e{level} parameter indicates which level of contents section
460you are dealing with. 0 denotes the main contents section in the
461topmost file \c{Contents.html}; 1 denotes a contents section in a
462chapter file; 2 is a contents section in a file containing a \c{\\H}
cb0b173d 463heading, and so on.
16ea3abe 464
465The \e{depth} parameter indicates the maximum depth of heading which
466will be shown in this contents section. Again, 1 denotes a chapter,
4672 is a \c{\\H} heading, 3 is a \c{\\S} heading, and so on.
468
cb0b173d 469So, for example: \cw{\\cfg\{html-contents-depth\}\{1\}\{3\}} instructs
16ea3abe 470Halibut to put contents links in chapter files for all sections down
471to \c{\\S} level, but not to go into any more detail than that.
472
cb0b173d 473For backwards compatibility, the alternative syntax
474\cw{\\cfg\{html-contents-depth-}\e{level}\cw{\}\{}\e{depth}\cw{\}}
475is also supported.
16ea3abe 476
cb0b173d 477}
16ea3abe 478
cb0b173d 479\dt \I{\cw{\\cfg\{html-leaf-contains-contents\}}}\cw{\\cfg\{html-leaf-contains-contents\}\{}\e{boolean}\cw{\}}
16ea3abe 480
481\dd If you set this to \c{true}, then each leaf file will contain
482its own contents section which summarises the text within it.
483
cb0b173d 484\dt \I{\cw{\\cfg\{html-leaf-smallest-contents\}}}\cw{\\cfg\{html-leaf-smallest-contents\}\{}\e{number}\cw{\}}
16ea3abe 485
486\dd Contents sections in leaf files are not output at all if they
487contain very few entries (on the assumption that it just isn't worth
488bothering). This directive configures the minimum number of entries
489required in a leaf contents section to make Halibut bother
490generating it at all.
491
492\S{output-html-html} Including pieces of your own HTML
493
494The directives in this section allow you to supply pieces of
339cbe09 495\I{HTML}\i{verbatim HTML} code, which will be included in various
496parts of the output files.
16ea3abe 497
cb0b173d 498Note that none of Halibut's usual character set translation is applied
499to this code; it is assumed to already be in a suitable encoding for
500the target HTML files.
501
502\dt \I{\cw{\\cfg\{html-head-end\}}}\cw{\\cfg\{html-head-end\}\{}\e{HTML text}\cw{\}}
16ea3abe 503
504\dd The text you provide in this directive is placed at the end of
339cbe09 505the \i\cw{<HEAD>} section of each output HTML file. So this is a
506good place to put, for example, a link to a \i{CSS} \i{stylesheet}.
16ea3abe 507
cb0b173d 508\dt \I{\cw{\\cfg\{html-local-head\}}}\cw{\\cfg\{html-local-head\}\{}\e{HTML text}\cw{\}}
9acfce4f 509
510\dd This configuration directive is local: you specify it within a
511document section, and it acts on that section only.
512
513\lcont{
514
515The text you provide in this directive is placed at the end of the
516\i\cw{<HEAD>} section of whichever output HTML file contains the
517section in which the directive was placed. You can specify this
518directive multiple times in multiple sections if you like.
519
520This directive is particularly useful for constructing \i{MacOS
521on-line help}, which is mostly normal HTML but which requires a
522special \i\cw{<META NAME="AppleTitle">} tag in the topmost source
523file. You can arrange this by placing this configuration directive
524in the preamble or the introduction section, something like this:
525
526\c \cfg{html-local-head}{<meta name="AppleTitle"
527\c content="MyApp Help">}
528
529}
530
cb0b173d 531\dt \I{\cw{\\cfg\{html-body-tag\}}}\cw{\\cfg\{html-body-tag\}\{}\e{HTML text}\cw{\}}
16ea3abe 532
533\dd The text you provide in this directive is used in place of the
339cbe09 534\i\cw{<BODY>} tag in each output file. So if you wanted to define a
535\i{background colour}, for example, you could write
cb0b173d 536\cw{\\cfg\{html-body-tag\}\{<body bg="#123456">\}}.
16ea3abe 537
cb0b173d 538\dt \I{\cw{\\cfg\{html-body-start\}}}\cw{\\cfg\{html-body-start\}\{}\e{HTML text}\cw{\}}
16ea3abe 539
540\dd The text you provide in this directive is placed at the
339cbe09 541beginning of the \i\cw{<BODY>} section of each output HTML file. So
542if you intend your HTML files to be part of a web site with a
543standard \i{house style}, and the style needs a \i{header} at the
544top of every page, this is where you can add that header.
16ea3abe 545
cb0b173d 546\dt \I{\cw{\\cfg\{html-body-end\}}}\cw{\\cfg\{html-body-end\}\{}\e{HTML text}\cw{\}}
16ea3abe 547
339cbe09 548\dd The text you provide in this directive is placed at the end of
cb0b173d 549the \i\cw{<BODY>} section of each output HTML file, before any address
550section. So if you intend your HTML files to be part of a web site
551with a standard \i{house style}, and the style needs a \i{footer} at
552the bottom of every page, this is where you can add that footer.
16ea3abe 553
cb0b173d 554\dt \I{\cw{\\cfg\{html-address-start\}}}\cw{\\cfg\{html-address-start\}\{}\e{HTML text}\cw{\}}
16ea3abe 555
556\dd The text you provide in this directive is placed at the
339cbe09 557beginning of the \i\cw{<ADDRESS>} section at the bottom of each
558output HTML file. This might be a good place to put authors'
559\i{contact details}, for example.
16ea3abe 560
cb0b173d 561\dt \I{\cw{\\cfg\{html-address-end\}}}\cw{\\cfg\{html-address-end\}\{}\e{HTML text}\cw{\}}
16ea3abe 562
339cbe09 563\dd The text you provide in this directive is placed at the end of
564the \i\cw{<ADDRESS>} section at the bottom of each output HTML file,
565after the version IDs (if present).
16ea3abe 566
cb0b173d 567\dt \I{\cw{\\cfg\{html-navigation-attributes\}}}\cw{\\cfg\{html-navigation-attributes\}\{}\e{HTML attributes}\cw{\}}
16ea3abe 568
569\dd The text you provide in this directive is included inside the
339cbe09 570\cw{<P>} tag containing the \i{navigation links} at the top of each
571page (\i{\q{Previous}} / \i{\q{Contents}} / \i{\q{Next}}). So if you
572wanted the navigation links to have a particular CSS style, you
573could write
cb0b173d 574\cw{\\cfg\{html-navigation-attributes\}\{class="foo"\}}, and the
16ea3abe 575navigation-links paragraph would then begin with the tag \cw{<p
576class="foo">}.
577
339cbe09 578\S{output-html-headings} \ii{Configuring heading display}
16ea3abe 579
cb0b173d 580\dt \I{\cw{\\cfg\{html-chapter-numeric\}}}\cw{\\cfg\{html-chapter-numeric\}\{}\e{boolean}\cw{\}}
16ea3abe 581
582\dd If this is set to \c{true}, then chapter headings will not
583contain the word \q{Chapter} (or whatever other word you have
584defined in its place - see \k{input-sections} and \k{input-config});
585they will just contain the chapter \e{number}, followed by the
586chapter title. If you set this to \c{false}, chapter headings will
587be prefixed by \q{Chapter} or equivalent.
588
cb0b173d 589\dt \I{\cw{\\cfg\{html-chapter-suffix\}}}\cw{\\cfg\{html-chapter-suffix\}\{}\e{text}\cw{\}}
16ea3abe 590
591\dd This specifies the suffix text to be appended to the chapter
592number, before displaying the chapter title. For example, if you set
b7747050 593this to \cq{:\_}, then the chapter title might look something
16ea3abe 594like \q{Chapter 2: Doing Things}.
595
cb0b173d 596\dt \I{\cw{\\cfg\{html-section-numeric\}}}\cw{\\cfg\{html-section-numeric\}\{}\e{level}\cw{\}\{}\e{boolean}\cw{\}}
597
598\# {level} can be omitted (defaults to 0). Is this intentional?
16ea3abe 599
600\dd Specifies whether section headings at a particular level should
601contain the word \q{Section} or equivalent (if \c{false}), or should
602be numeric only (if \c{true}). The \e{level} parameter specifies
603which level of section headings you want to affect: 0 means
604first-level headings (\c{\\H}), 1 means second-level headings
605(\c{\\S}), 2 means the level below that (\c{\\S2}), and so on.
606
cb0b173d 607\dt \I{\cw{\\cfg\{html-section-suffix\}}}\cw{\\cfg\{html-section-suffix\}\{}\e{level}\cw{\}\{}\e{text}\cw{\}}
608
609\# {level} can be omitted (defaults to 0). Is this intentional?
16ea3abe 610
611\dd Specifies the suffix text to be appended to section numbers at a
612particular level, before displaying the section title.
613
cb0b173d 614\S{output-html-names} Configuring standard text
615
616These directives let you fine-tune the names Halibut uses in places
617such as the navigation bar to refer to various parts of the document,
618and other standard pieces of text, for instance to change them to a
619different language.
620
621\dt \I{\cw{\\cfg\{html-preamble-text\}}}\cw{\\cfg\{html-preamble-text\}\{}\e{text}\cw{\}}
622
623\dt \I{\cw{\\cfg\{html-contents-text\}}}\cw{\\cfg\{html-contents-text\}\{}\e{text}\cw{\}}
624
625\dt \I{\cw{\\cfg\{html-index-text\}}}\cw{\\cfg\{html-index-text\}\{}\e{text}\cw{\}}
626
627\dd Text used to refer to the preamble (i.e., any paragraphs before
628the first chapter heading), contents, and index respectively, in the
629navigation bar, contents, and index.
630
f6220253 631\lcont{
632
633(\c{html-contents-text} and \c{html-index-text} override the
634cross-format configuration keywords \c{contents} and \c{index} (see
635\k{input-config}, if both appear. They are legacy keywords preserved
636for backwards compatibility; you should generally use \c{contents}
637and \c{index}.)
638
639}
640
cb0b173d 641\dt \I{\cw{\\cfg\{html-title-separator\}}}\cw{\\cfg\{html-title-separator\}\{}\e{text}\cw{\}}
642
643\dd If multiple headings are used in a file's \cw{<TITLE>} tag, this
644text is used to separate them.
645
646\# Under what circumstances can this occur?
647
648\dt \I{\cw{\\cfg\{html-index-main-separator\}}}\cw{\\cfg\{html-index-main-separator\}\{}\e{text}\cw{\}}
649
650\dd Separator between index term and references in the index.
651
652\dt \I{\cw{\\cfg\{html-index-multiple-separator\}}}\cw{\\cfg\{html-index-multiple-separator\}\{}\e{text}\cw{\}}
653
654\dd Separator between multiple references for a single index term in
655the index.
656
657\dt \I{\cw{\\cfg\{html-pre-versionid\}}}\cw{\\cfg\{html-pre-versionid\}\{}\e{text}\cw{\}}
658
659\dt \I{\cw{\\cfg\{html-post-versionid\}}}\cw{\\cfg\{html-post-versionid\}\{}\e{text}\cw{\}}
660
661\dd Text surrounding each output \i{version ID paragraph}.
662
663\dt \I{\cw{\\cfg\{html-nav-prev-text\}}}\cw{\\cfg\{html-nav-prev-text\}\{}\e{text}\cw{\}}
664
665\dt \I{\cw{\\cfg\{html-nav-next-text\}}}\cw{\\cfg\{html-nav-next-text\}\{}\e{text}\cw{\}}
666
667\dd The text used for the \q{previous page} and \q{next page} links on
668the navigation bar.
669
670\dt \I{\cw{\\cfg\{html-nav-separator\}}}\cw{\\cfg\{html-nav-separator\}\{}\e{text}\cw{\}}
671
672\dd Separator between links in the navigation bar.
673
674\S{output-html-characters} Configuring the characters used
675
676Unlike the other backends, HTML does not have a single
677\i\cw{\\cfg\{html-charset\}} directive, as there are several levels of
678character encoding to consider.
679
680The character set names are the same as for
681\cw{\\cfg\{input-charset\}} (see \k{input-config}). However, unlike
682\cw{\\cfg\{input-charset\}}, these directives affect the \e{entire}
683output; it's not possible to switch encodings halfway through.
684
685\dt \I\cw{\\cfg\{html-output-charset\}}\cw{\\cfg\{html-output-charset\}\{}\e{character set name}\cw{\}}
686
687\dd The character encoding of the HTML file to be output. Unicode
688characters in this encoding's repertoire are included literally rather
689than as \i{HTML entities}.
690
691\dt \I\cw{\\cfg\{html-restrict-charset\}}\cw{\\cfg\{html-restrict-charset\}\{}\e{character set name}\cw{\}}
692
693\dd Only Unicode characters representable in this character set will be
694output; any others will be omitted and use their fallback text, if
695any. Characters not in \q{html-output-charset} will be represented as
696HTML numeric entities.
697
698\dt \I{\cw{\\cfg\{html-quotes\}}}\cw{\\cfg\{html-quotes\}\{}\e{open-quote}\cw{\}\{}\e{close-quote}\cw{\}}[\cw{\{}\e{open-quote}\cw{\}\{}\e{close-quote}...\cw{\}}]
699
700\dd Specifies the quotation marks to use, overriding any
701\cw{\\cfg\{quotes\}} directive. You can specify multiple
702fallback options. Works exactly like the \cw{\\cfg\{text-quotes\}}
703directive (see \k{output-text-characters}).
704
16ea3abe 705\S{output-html-misc} Miscellaneous options
706
cb0b173d 707\dt \I\cw{\\cfg\{html-version\}}\cw{\\cfg\{html-version\}\{}\e{version}\cw{\}}
708
709\dd Identifies the precise version of HTML that is output. This
710affects the declaration within the HTML, and also has minor effects on
beedb0b3 711the body of the HTML so that it is valid for the declared version. The
cb0b173d 712available variants are:
713
714\lcont{
715
beedb0b3 716\dt \cw{html3.2}
cb0b173d 717
beedb0b3 718\dd W3C HTML 3.2
cb0b173d 719
beedb0b3 720\dt \cw{html4}
cb0b173d 721
beedb0b3 722\dd W3C HTML 4.01 Strict
cb0b173d 723
beedb0b3 724\dt \cw{iso-html}
725
726\dd ISO/IEC 15445:2000
727
728\dt \cw{xhtml1.0transitional}
729
730\dd W3C XHTML 1.0 Transitional
731
732\dt \cw{xhtml1.0strict}
733
734\dd W3C XHTML 1.0 Strict
cb0b173d 735
736}
737
12f0ee84 738\dt \I{\cw{\\cfg\{html-template-fragment\}}}\cw{\\cfg\{html-template-fragment\}\{}\e{template}\cw{\}}[\cw{\{}\e{template}\cw{\}\{}...\cw{\}}]
0a6347b4 739
740\dd This directive lets you specify a \i{template}, with exactly the
cb0b173d 741same syntax used in \cw{\\cfg\{html-template-filename\}} (see
12f0ee84 742\k{output-html-file}), to be used for the anchor names (\i\cw{<a
743name="...">}) used to allow URLs to refer to specific sections
b7747050 744within a particular HTML file. So if you set this to \cq{%k},
fc8e7adb 745for example, then each individual section in your document will be
0a6347b4 746addressable by means of a URL ending in a \c{#} followed by your
747internal section keyword.
748
cb0b173d 749\lcont{
750
12f0ee84 751If more than one template is specified, anchors are generated in all
752the specified formats; Halibut's own cross-references are generated
753with the first template.
754
755Characters that are not permitted in anchor names are stripped. If
756there are no valid characters left, or a fragment is non-unique,
757Halibut starts inventing fragment names and suffixes as appropriate.
758
759Note that there are potentially fragment names that are not controlled
760by this mechanism, such as index references.
cb0b173d 761
762}
763
764\dt \I{\cw{\\cfg\{html-versionid\}}}\cw{\\cfg\{html-versionid\}\{}\e{boolean}\cw{\}}
16ea3abe 765
339cbe09 766\dd If this is set to \c{true}, \i{version ID paragraphs} (defined using
767the \i\c{\\versionid} command - see \k{input-blurb}) will be included
768visibly in the \i\cw{<ADDRESS>} section at the bottom of each HTML
cb0b173d 769file. If it is set to \c{false}, they will only be included as HTML
770comments.
16ea3abe 771
1aed5cf5 772\dt \I{\cw{\\cfg\{html-rellinks\}}}\cw{\\cfg\{html-rellinks\}\{}\e{boolean}\cw{\}}
773
774\dd If this is set to \c{true}, machine-readable relational links will
775be emitted in each HTML file (\I{\cw{<LINK>} tags}\cw{<LINK
776REL="}\e{next}\cw{">} and so on within the \i\cw{<HEAD>} section)
777providing links to related files. The same set of links are provided
778as in the navigation bar (with which this should not be confused).
779
780\lcont{
781
782Some browsers make use of this semantic information, for instance to
783allow easy navigation through related pages, and to prefetch the next
784page. However, many browsers ignore this markup, so it would be unwise
785to rely on it for navigation.
786
787The use and rendering of this information is entirely up to the
788browser; none of the other Halibut options for the navigation bar will
789have any effect.
790
791}
792
f2ef00b5 793\dt \I{\cw{\\cfg\{html-suppress-navlinks\}}}\cw{\\cfg\{html-suppress-navlinks\}\{}\e{boolean}\cw{\}}
794
1aed5cf5 795\dd If this is set to \c{true}, the usual \i{navigation links} within
796the \e{body} of each HTML file (near the top of the rendered page) will
797be suppressed.
f2ef00b5 798
cb0b173d 799\dt \I{\cw{\\cfg\{html-suppress-address\}}}\cw{\\cfg\{html-suppress-address\}\{}\e{boolean}\cw{\}}
16ea3abe 800
339cbe09 801\dd If this is set to \c{true}, the \i\cw{<ADDRESS>} section at the
16ea3abe 802bottom of each HTML file will be omitted completely. (This will
cb0b173d 803therefore also cause \i{version IDs} not to be included visibly.)
16ea3abe 804
cb0b173d 805\dt \I{\cw{\\cfg\{html-author\}}}\cw{\\cfg\{html-author\}\{}\e{text}\cw{\}}
16ea3abe 806
339cbe09 807\dd The text supplied here goes in a \I{\cw{<META>} tags}\cw{<META
808name="author">} tag in the output HTML files, so that browsers which
809support this can automatically identify the \i{author} of the document.
16ea3abe 810
cb0b173d 811\dt \I{\cw{\\cfg\{html-description\}}}\cw{\\cfg\{html-description\}\{}\e{text}\cw{\}}
16ea3abe 812
339cbe09 813\dd The text supplied here goes in a \I{\cw{<META>} tags}\cw{<META
814name="description">} tag in the output HTML files, so that browsers
815which support this can easily pick out a brief \I{description, of
816document}description of the document.
16ea3abe 817
f2ef00b5 818\S{output-html-mshtmlhelp} Generating MS Windows \i{HTML Help}
819
820The HTML files output from Halibut's HTML back end can be used as
821input to the MS Windows HTML Help compiler. In order to do this, you
822also need some auxiliary files: a project file, and (probably) a
823contents file and an index file. Halibut can optionally generate
824those as well.
825
826To enable the generation of MS HTML Help auxiliary files, use the
827following configuration directives:
828
829\dt \I\cw{\\cfg\{html-mshtmlhelp-project\}}\cw{\\cfg\{html-mshtmlhelp-project\}\{}\e{filename}\cw{\}}
830
831\dd Instructs Halibut to output an HTML Help project file with the
832specified name. You will almost certainly want the filename to end
833in the extension \c{.hhp} (although Halibut will not enforce this).
834If you use this option, you must also use the
835\cw{html-mshtmlhelp-chm} option to specify the desired name of the
836compiled help file.
837
838\dt \I\cw{\\cfg\{html-mshtmlhelp-chm\}}\cw{\\cfg\{html-mshtmlhelp-chm\}\{}\e{filename}\cw{\}}
839
840\dd Specifies the desired name of the compiled HTML Help file. You
841will almost certainly want this to have the extension \c{.chm}
842(although Halibut will not enforce this). The name you specify here
843will be written into the help project file. If you specify this
844option, you must also use the \cw{html-mshtmlhelp-project} option to
845request a help project file in the first place.
846
847\dt \I\cw{\\cfg\{html-mshtmlhelp-contents\}}\cw{\\cfg\{html-mshtmlhelp-contents\}\{}\e{filename}\cw{\}}
848
849\dd Instructs Halibut to output an HTML Help contents file with the
850specified name, and refer to it in the help project file. You will
851almost certainly want the filename to end in the extension \c{.hhc}
852(although Halibut will not enforce this). This option will be
853ignored if you have not also specified a help project file.
854
855\lcont{
856
857Creating a contents file like this causes the HTML Help viewer to
858display a contents tree in the pane to the left of the main text
859window. You can choose to generate an HTML Help project without this
860feature, in which case the user will still be able to navigate
861around the document by using the ordinary internal links in the HTML
862files themselves just as if it were a web page. However, using a
863contents file is recommended.
864
865}
866
867\dt \I\cw{\\cfg\{html-mshtmlhelp-index\}}\cw{\\cfg\{html-mshtmlhelp-index\}\{}\e{filename}\cw{\}}
868
869\dd Instructs Halibut to output an HTML Help index file with the
870specified name, and refer to it in the help project file. You will
871almost certainly want the filename to end in the extension \c{.hhk}
872(although Halibut will not enforce this). This option will be
873ignored if you have not also specified a help project file.
874
875\lcont{
876
877Specifying this option suppresses the generation of an HTML-based
878index file (see \cw{\\cfg\{html-index-filename\}} in
879\k{output-html-file}).
880
881Creating an index file like this causes the HTML Help viewer to
882provide a list of index terms in a pane to the left of the main text
883window. You can choose to generate an HTML Help project without this
884feature, in which case a conventional HTML index will be generated
885instead (assuming you have any index terms at all defined) and the
886user will still be able to use that. However, using an index file is
887recommended.
888
889Halibut will not output an index file at all, or link to one from
890the help project file, if your document contains no index entries.
891
892}
893
894If you use the above options, Halibut will output a help project
895file which you should be able to feed straight to the command-line
896MS HTML Help compiler (\cw{HHC.EXE}), or load into the MS HTML Help
897Workshop (\cw{HHW.EXE}).
898
899You may also wish to alter other HTML configuration options to make
900the resulting help file look more like a help file and less like a
901web page. A suggested set of additional configuration options for
902HTML Help is as follows:
903
904\b \cw{\\cfg\{html-leaf-level\}\{infinite\}}, because HTML Help
905works best with lots of small files (\q{topics}) rather than a few
906large ones. In particular, the contents and index mechanisms can
907only reference files, not subsections within files.
908
909\b \cw{\\cfg\{html-leaf-contains-contents\}\{false\}}, to suppress
910the contents list above the main text of each bottom-level file.
911
912\b \cw{\\cfg\{html-suppress-navlinks\}\{true\}}, because HTML Help
913has its own navigation facilities and it looks a bit strange to
914duplicate them.
915
916\b \cw{\\cfg\{html-suppress-address\}\{true\}}, because the
917\cw{<address>} section makes less sense in a help file than it does
918on a web page.
919
16ea3abe 920\S{output-html-defaults} Default settings
921
339cbe09 922The \i{default settings} for Halibut's HTML output format are:
16ea3abe 923
cb0b173d 924\c \cfg{html-contents-filename}{Contents.html}
925\c \cfg{html-index-filename}{IndexPage.html}
926\c \cfg{html-template-filename}{%n.html}
927\c \cfg{html-single-filename}{Manual.html}
16ea3abe 928\c
cb0b173d 929\c \cfg{html-leaf-level}{2}
930\c \cfg{html-leaf-contains-contents}{false}
931\c \cfg{html-leaf-smallest-contents}{4}
932\c \cfg{html-contents-depth}{0}{2}
933\c \cfg{html-contents-depth}{1}{3}
934\c ... and so on for all section levels below this ...
935\e iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
16ea3abe 936\c
cb0b173d 937\c \cfg{html-head-end}{}
938\c \cfg{html-body-tag}{<body>}
939\c \cfg{html-body-start}{}
940\c \cfg{html-body-end}{}
941\c \cfg{html-address-start}{}
942\c \cfg{html-address-end}{}
943\c \cfg{html-navigation-attributes}{}
16ea3abe 944\c
cb0b173d 945\c \cfg{html-chapter-numeric}{false}
946\c \cfg{html-chapter-suffix}{: }
16ea3abe 947\c
cb0b173d 948\c \cfg{html-section-numeric}{0}{true}
949\c \cfg{html-section-suffix}{0}{ }
16ea3abe 950\c
cb0b173d 951\c \cfg{html-section-numeric}{1}{true}
952\c \cfg{html-section-suffix}{1}{ }
16ea3abe 953\c
954\c ... and so on for all section levels below this ...
955\e iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
cb0b173d 956\c
957\c \cfg{html-preamble-text}{Preamble}
958\c \cfg{html-contents-text}{Contents}
959\c \cfg{html-index-text}{Index}
960\c \cfg{html-title-separator}{ - }
961\c \cfg{html-index-main-separator}{: }
962\c \cfg{html-index-multiple-separator}{, }
963\c \cfg{html-pre-versionid}{[}
964\c \cfg{html-post-versionid}{]}
965\c \cfg{html-nav-prev-text}{Previous}
966\c \cfg{html-nav-next-text}{Next}
967\c \cfg{html-nav-separator}{ | }
968\c
969\c \cfg{html-output-charset}{ASCII}
970\c \cfg{html-restrict-charset}{UTF-8}
971\c \cfg{html-quotes}{\u2018}{\u2019}{"}{"}
972\c
973\c \cfg{html-version}{html4}
974\c \cfg{html-template-fragment}{%b}
975\c \cfg{html-versionid}{true}
1aed5cf5 976\c \cfg{html-include-rellinks}{false}
977\c \cfg{html-suppress-navlinks{false}
cb0b173d 978\c \cfg{html-suppress-address}{false}
979\c \cfg{html-author}{}
980\c \cfg{html-description}{}
16ea3abe 981
982\H{output-whlp} Windows Help
983
339cbe09 984This output format generates data that can be used by the \i{Windows
f2ef00b5 985Help} program \cw{WINHLP32.EXE}. There are two actual files
0a6347b4 986generated, one ending in \c{.hlp} and the other ending in \c{.cnt}.
987
f2ef00b5 988Note that as of 2006, MS is discontinuing the Windows Help format in
989favour of the newer HTML Help format (\c{.chm} files). Halibut is
990not currently able to generate \c{.chm} files directly, but its HTML
991back end can write out project files suitable for use as input to
992the MS HTML Help compiler. See \k{output-html-mshtmlhelp} for more
993information on this.
994
995Currently, the Windows Help output is hardcoded to be in the
996\q{\i{Win1252}} character set. (If anyone knows how character sets
997are encoded in Windows Help files, we'd appreciate help.)
6069815a 998
0a6347b4 999The Windows Help output format supports the following configuration
1000directives:
1001
6b4dfd74 1002\S{output-whlp-file} Output file name
1003
0a6347b4 1004\dt \I{\cw{\\cfg\{winhelp-filename\}}}\cw{\\cfg\{winhelp-filename\}\{}\e{filename}\cw{\}}
1005
1006\dd Sets the \i{output file name} in which to store the man page.
1007This directive is implicitly generated if you provide a file name
1008parameter after the command-line option \i\c{--winhelp} (see
1009\k{running-options}).
1010
1011\lcont{
1012
1013Your output file name should end with \c{.hlp}; if it doesn't,
1014Halibut will append it. Halibut will also generate a contents file
1015(ending in \c{.cnt}) alongside the file name you specify.
1016
1017}
16ea3abe 1018
6b4dfd74 1019\S{output-whlp-characters} Configuring the characters used
1020
1021\dt \I{\cw{\\cfg\{winhelp-bullet\}}}\cw{\\cfg\{winhelp-bullet\}\{}\e{text}\cw{\}}[\cw{\{}\e{text}\cw{\}}...]
1022
1023\dd Specifies the text to use as the \i{bullet} in bulletted lists.
1024You can specify multiple fallback options. Works exactly like the
1025\cw{\\cfg\{text-bullet\}} directive (see
1026\k{output-text-characters}).
1027
1028\dt \I{\cw{\\cfg\{winhelp-quotes\}}}\cw{\\cfg\{winhelp-quotes\}\{}\e{open-quote}\cw{\}\{}\e{close-quote}\cw{\}}[\cw{\{}\e{open-quote}\cw{\}\{}\e{close-quote}...\cw{\}}]
1029
1030\dd Specifies the quotation marks to use, overriding any
1031\cw{\\cfg\{quotes\}} directive. You can specify multiple
1032fallback options. Works exactly like the \cw{\\cfg\{text-quotes\}}
1033directive (see \k{output-text-characters}).
1034
1035\S{output-whlp-misc} Miscellaneous configuration options
1036
6069815a 1037\dt \I{\cw{\\cfg\{winhelp-contents-titlepage\}}}\cw{\\cfg\{winhelp-contents-titlepage\}\{}\e{title}\cw{\}}
1038
1039\dd Sets the text used to describe the help page containing the blurb
1040(see \k{input-blurb}) and table of contents.
1041
1042\dt
1043\I{\cw{\\cfg\{winhelp-section-suffix\}}}\cw{\\cfg\{winhelp-section-suffix\}\{}\e{text}\cw{\}}
1044
1045\dd Specifies the \I{suffix text, in section titles}suffix text to
1046be appended to section numbers, before displaying the section title.
1047(Applies to all levels.)
1048
1049\dt \I{\cw{\\cfg\{winhelp-list-suffix\}}}\cw{\\cfg\{winhelp-list-suffix\}\{}\e{text}\cw{\}}
1050
1051\dd This text is appended to the number on a \i{numbered list} item,
1052in exactly the same way as \cw{\\cfg\{text-list-suffix\}} (see
6069815a 1053\k{output-text-characters}).
1054
339cbe09 1055\dt \I{\cw{\\cfg\{winhelp-topic\}}}\cw{\\cfg\{winhelp-topic\}\{}\e{topic-name}\cw{\}}
16ea3abe 1056
339cbe09 1057\dd This directive defines a Windows \i{Help topic} name in the current
16ea3abe 1058section. Topic names can be used by the program invoking
1059\cw{WINHELP.EXE} to jump straight to a particular section. So you
339cbe09 1060can use this for \i{context-sensitive help}.
16ea3abe 1061
1062\lcont{
1063
1064For example, if you used this directive in a particular section:
1065
1066\c \cfg{winhelp-topic}{savingfiles}
1067
1068then a Windows application could invoke Windows Help to jump to that
1069particular section in the help file like this:
1070
1071\c WinHelp(hwnd, "mydoc.hlp", HELP_COMMAND,
1072\c (DWORD)"JI(`',`savingfiles')");
1073
1074You can use this configuration directive many times, in many
1075different subsections of your document, in order to define a lot of
1076different help contexts which you can use in this way.
1077
1078}
1079
6b4dfd74 1080\S{output-whlp-defaults} Default settings
1081
0a6347b4 1082The \i{default settings} for the Windows Help output format are:
1083
1084\c \cfg{winhelp-filename}{output.hlp}
6b4dfd74 1085\c
1086\c \cfg{winhelp-bullet}{\u2022}{-}
1087\c \cfg{winhelp-quotes}{\u2018}{\u2019}{"}{"}
1088\c
6069815a 1089\c \cfg{winhelp-contents-titlepage}{Title page}
1090\c \cfg{winhelp-section-suffix}{: }
1091\c \cfg{winhelp-list-suffix}{.}
0a6347b4 1092
1093and no \c{\\cfg\{winhelp-topic\}} directives anywhere.
1094
16ea3abe 1095\H{output-man} Unix \cw{man} pages
1096
339cbe09 1097This output format generates a Unix \i{\cw{man} page}. That is to say,
1098it generates \i\c{nroff} input designed to work with the \c{-mandoc}
16ea3abe 1099macro package.
1100
1101The available configuration options for this format are as follows:
1102
6b4dfd74 1103\S{output-man-file} Output file name
1104
0a6347b4 1105\dt \I{\cw{\\cfg\{man-filename\}}}\cw{\\cfg\{man-filename\}\{}\e{filename}\cw{\}}
1106
1107\dd Sets the \i{output file name} in which to store the man page.
1108This directive is implicitly generated if you provide a file name
1109parameter after the command-line option \i\c{--man} (see
1110\k{running-options}).
1111
6b4dfd74 1112\S{output-man-identity} Configuring headers and footers
1113
339cbe09 1114\dt \I{\cw{\\cfg\{man-identity\}}}\cw{\\cfg\{man-identity\}\{}\e{text}\cw{\}\{}\e{text...}\cw{\}}
16ea3abe 1115
339cbe09 1116\dd This directive is used to generate the initial \i{\c{.TH}
1117directive} that appears at the top of a \cw{man} page. It expects to
1118be followed by some number of brace pairs containing text, which will
1119be used in the \i{headers} and \i{footers} of the formatted output.
16ea3abe 1120
1121\lcont{
1122
1123A traditional order for the arguments appears to be:
1124
1125\n The name of the program.
1126
1127\n The (numeric) manual section.
1128
1129\n The date that the \cw{man} page was written.
1130
1131\n The name of any containing suite of which the program is a part.
1132
339cbe09 1133\n The name of the \i{author} of the \cw{man} page.
16ea3abe 1134
1135For example, a typical \cw{man} page might contain
1136
fc8e7adb 1137\c \cfg{man-identity}{make-foo}{1}{June 2003}{foo-utils}{Fred
1138\c Bloggs}
16ea3abe 1139
1140}
1141
6b4dfd74 1142\S{output-man-headings} Configuring heading display
1143
339cbe09 1144\dt \I{\cw{\\cfg\{man-headnumbers\}}}\cw{\\cfg\{man-headnumbers\}\{}\e{boolean}\cw{\}}
16ea3abe 1145
339cbe09 1146\dd If this is set to \c{true}, then \i{section headings} in the
1147\cw{man} page will have their \i{section numbers} displayed as usual. If
16ea3abe 1148set to \c{false}, the section numbers will be omitted. (\cw{man}
1149pages traditionally have section names such as \q{SYNOPSIS},
1150\q{OPTIONS} and \q{BUGS}, and do not typically number them, so
1151\c{false} is the setting which conforms most closely to normal
1152\cw{man} style.)
1153
339cbe09 1154\dt \I{\cw{\\cfg\{man-mindepth\}}}\cw{\\cfg\{man-mindepth\}\{}\e{depth}\cw{\}}
16ea3abe 1155
1156\dd If this is set to a number greater than 0, then section headings
1157\e{higher} than the given depth will not be displayed. If it is set
1158to zero, all section headings will be displayed as normal.
1159
1160\lcont{
1161
1162The point of this is so that you can use the same Halibut input file
1163to generate a quick-reference \cw{man} page for a program, \e{and} to
1164include that \cw{man} page as an appendix in your program's full manual.
1165If you are to include the \cw{man} page as an appendix, then the internal
1166headings within the page will probably need to be at \c{\\H} or
1167\c{\\S} level; therefore, when you format that input file on its own
1168to create the \cw{man} page itself, you will need to have defined a
1169\c{\\C} and possibly a \c{\\H} heading beforehand, which you don't
1170want to see displayed.
1171
1172Here's an example. You might have a file \c{appendix.but}, which
1173simply says
1174
1175\c \A{manpages} \cw{man} pages for the Foo tool suite
1176\c
1177\c \cfg{man-mindepth}{2}
1178
1179Then you have a file \c{make-foo.but}, and probably others like it
1180as well, each of which looks something like this:
1181
fc8e7adb 1182\c \cfg{man-identity}{make-foo}{1}{June 2003}{foo-utils}{Fred
1183\c Bloggs}
16ea3abe 1184\c
1185\c \H{man-foo} \cw{man} page for \c{make-foo}
1186\c
1187\c \S{man-foo-name} NAME
1188\c
1189\c \c{make-foo} - create Foo files for the Foo tool suite
1190\c
1191\c \S{man-foo-synopsis} SYNOPSIS
1192\c
1193\c ... and so on ...
1194\e iiiiiiiiiiiiiiiii
1195
1196So when you're generating your main manual, you can include
1197\c{appendix.but} followed by \c{make-foo.but} and any other \cw{man}
1198pages you have, and your \cw{man} pages will be formatted neatly as
1199part of an appendix. Then, in a separate run of Halibut, you can
1200just do
1201
1202\c halibut appendix.but make-foo.but
1203
1204and this will generate a \cw{man} page \c{output.1}, in which the
1205headings \q{\cw{man} pages for the Foo tool suite} and \q{\cw{man}
1206page for \c{make-foo}} will not be displayed because of the
1207\c{man-mindepth} directive. So the first visible heading in the
1208output \cw{man} page will be \q{NAME}, exactly as a user would
1209expect.
1210
1211}
1212
6b4dfd74 1213\S{output-man-characters} Configuring the characters used
1214
6069815a 1215\dt \I{\cw{\\cfg\{man-charset\}}}\cw{\\cfg\{man-charset\}\{}\e{character set}\cw{\}}
1216
1217\dd Specifies what character set the output should be in, similarly to
6b4dfd74 1218\cw{\\cfg\{text-charset\}} (see \k{output-text-characters}).
6069815a 1219
1220\# FIXME: you're probably on your own in making sure that it's
1221sensible to output man pages in that charset.
1222
1223\dt \I{\cw{\\cfg\{man-bullet\}}}\cw{\\cfg\{man-bullet\}\{}\e{text}\cw{\}}[\cw{\{}\e{text}\cw{\}}...]
1224
1225\dd Specifies the text to use as the \i{bullet} in bulletted lists.
1226You can specify multiple fallback options. Works exactly like the
1227\cw{\\cfg\{text-bullet\}} directive (see \k{output-text-characters}).
1228
2a2375db 1229\dt \I{\cw{\\cfg\{man-rule\}}}\cw{\\cfg\{man-rule\}\{}\e{text}\cw{\}}[\cw{\{}\e{text}...\cw{\}}]
1230
1231\dd This specifies the text which should be used for drawing
1232\i{horizontal rules} (generated by \i\c{\\rule}; see
1233\k{input-rule}) when the manual page is rendered into text.
1234It should only be one character long, but otherwise
1235it works like the \cw{\\cfg\{text-rule\}} directive
1236(see \k{output-text-characters}).
1237
6069815a 1238\dt \I{\cw{\\cfg\{man-quotes\}}}\cw{\\cfg\{man-quotes\}\{}\e{open-quote}\cw{\}\{}\e{close-quote}\cw{\}}[\cw{\{}\e{open-quote}\cw{\}\{}\e{close-quote}...\cw{\}}]
1239
1240\dd Specifies the quotation marks to use, overriding any
1241\cw{\\cfg\{quotes\}} directive. You can specify multiple
1242fallback options. Works exactly like the \cw{\\cfg\{text-quotes\}}
1243directive (see \k{output-text-characters}).
1244
6b4dfd74 1245\S{output-man-defaults} Default settings
1246
339cbe09 1247The \i{default settings} for the \cw{man} page output format are:
16ea3abe 1248
0a6347b4 1249\c \cfg{man-filename}{output.1}
6b4dfd74 1250\c
16ea3abe 1251\c \cfg{man-identity}{}
6b4dfd74 1252\c
16ea3abe 1253\c \cfg{man-headnumbers}{false}
1254\c \cfg{man-mindepth}{0}
6b4dfd74 1255\c
6069815a 1256\c \cfg{man-charset}{ASCII}
1257\c \cfg{man-bullet}{\u2022}{o}
2a2375db 1258\c \cfg{man-rule}{\u2500}{-}
6069815a 1259\c \cfg{man-quotes}{\u2018}{\u2019}{"}{"}
43f61c25 1260
1261\H{output-info} GNU \c{info}
1262
1263This output format generates files which can be used with the \i{GNU
1264\c{info}} program.
1265
1266There are typically multiple output files: a primary file whose name
1267usually ends in \c{.info}, and one or more subsidiary files whose
1268names have numbers on the end, so that they end in \c{.info-1},
1269\c{.info-2} and so on. Alternatively, this output format can be
1270configured to output a single large file containing the whole
1271document.
1272
1273The \c{info} output format supports the following configuration
1274directives:
1275
6b4dfd74 1276\S{output-info-file} Controlling the output filenames
1277
43f61c25 1278\dt \I{\cw{\\cfg\{info-filename\}}}\cw{\\cfg\{info-filename\}\{}\e{filename}\cw{\}}
1279
1280\dd Sets the output file name in which to store the \c{info} file.
1281This directive is implicitly generated if you provide a file name
1282parameter after the command-line option \i\c{--info} (see
1283\k{running-options}).
1284
1285\lcont{
1286
1287The suffixes \c{-1}, \c{-2}, \c{-3} and so on will be appended to
1288your output file name to produce any subsidiary files required.
1289
1290Note that \c{info} files refer to their own names internally, so
1291these files cannot be \I{renaming \c{info} files}renamed after
1292creation and remain useful.
1293
1294}
1295
6b4dfd74 1296\dt \I{\cw{\\cfg\{info-max-file-size\}}}\cw{\\cfg\{info-max-file-size\}\{}\e{bytes}\cw{\}}
1297
1298\dd Sets the preferred \i{maximum file size} for each subsidiary
1299file. As a special case, if you set this to zero, there will be no
1300subsidiary files and the whole document will be placed in a single
1301self-contained output file. (However, note that this file can still
1302not be renamed usefully.)
1303
1304\lcont{
1305
1306The preferred maximum file size is only a guideline. Halibut may be
1307forced to exceed it if a single section of the document is larger
1308than the maximum size (since individual \c{info} nodes may not be
1309split between files).
1310
1311}
1312
1313\S{output-info-dimensions} Indentation and line width
1314
5b1d0032 1315\dt \I{\cw{\\cfg\{info-width\}}}\cw{\\cfg\{info-width\}\{}\e{width}\cw{\}}
1316
1317\dd Sets the \I{text width}width of the main part of the document,
1318in characters. Works exactly like the \cw{\\cfg\{text-width\}}
1319directive (see \k{output-text-dimensions}).
1320
1321\dt \I{\cw{\\cfg\{info-indent-code\}}}\cw{\\cfg\{info-indent-code\}\{}\e{indent}\cw{\}}
1322
1323\dd Specifies the extra indentation for \I{code paragraphs,
1324indentation} code paragraphs. Works exactly like the
1325\cw{\\cfg\{text-indent-code\}} directive (see
1326\k{output-text-dimensions}).
1327
1328\dt \I{\cw{\\cfg\{info-index-width\}}}\cw{\\cfg\{info-index-width\}\{}\e{width}\cw{\}}
1329
1330\dd Specifies how much horizontal space to leave in the index node
1331for the text of \i{index terms}, before displaying the sections the
1332terms occur in.
1333
1334\dt \I{\cw{\\cfg\{info-list-indent\}}}\cw{\\cfg\{info-list-indent\}\{}\e{indent}\cw{\}}
1335
1336\dd Specifies the extra indentation before the bullet or number in a
1337\I{bulletted list, indentation}\I{numbered list, indentation}list
1338item. Works exactly like the \cw{\\cfg\{text-list-indent\}}
1339directive (see \k{output-text-dimensions}).
1340
1341\dt \I{\cw{\\cfg\{info-listitem-indent\}}}\cw{\\cfg\{info-listitem-indent\}\{}\e{indent}\cw{\}}
1342
1343\dd Specifies the additional indentation before the body of a list
1344item. Works exactly like the \cw{\\cfg\{text-listitem-indent\}}
1345directive (see \k{output-text-dimensions}).
1346
6b4dfd74 1347\S{output-info-headings} Configuring heading display
6069815a 1348
5b1d0032 1349\dt \I{\cw{\\cfg\{info-section-suffix\}}}\cw{\\cfg\{info-section-suffix\}\{}\e{text}\cw{\}}
1350
1351\dd Specifies the suffix text to be appended to each section number
1352before displaying the section title. For example, if you set this to
b7747050 1353\cq{:\_}, then a typical section title might look something like
5b1d0032 1354\q{Section 3.1: Something Like This}.
1355
1356\dt \I{\cw{\\cfg\{info-underline\}}}\cw{\\cfg\{info-underline\}\{}\e{text}\cw{\}}[\cw{\{}\e{text}\cw{\}}...]
1357
1358\dd Specifies the text to be used to underline section titles. Works
1359very much like the \cw{\\cfg\{text-chapter-underline\}} directive
1360(see \k{output-text-headings}). You can specify more than one
1361option, and Halibut will choose the first one supported by the
1362character set.
1363
6b4dfd74 1364\S{output-info-characters} Controlling the characters used
1365
1366\dt \I{\cw{\\cfg\{info-charset\}}}\cw{\\cfg\{info-charset\}\{}\e{character set}\cw{\}}
1367
1368\dd Specifies what character set the output should be in, similarly to
1369\cw{\\cfg\{text-charset\}} (see \k{output-text-characters}).
1370
1371\# FIXME: if you try sufficiently hard, you can probably find an
1372output encoding that will break the info format by trampling on its
1373special characters. So either don't do that, or tell us what we should
1374do about it.
1375
5b1d0032 1376\dt \I{\cw{\\cfg\{info-bullet\}}}\cw{\\cfg\{info-bullet\}\{}\e{text}\cw{\}}[\cw{\{}\e{text}\cw{\}}...]
1377
1378\dd Specifies the text to use as the \i{bullet} in bulletted lists.
1379You can specify multiple fallback options. Works exactly like the
1380\cw{\\cfg\{text-bullet\}} directive (see
1381\k{output-text-characters}).
1382
1383\dt \I{\cw{\\cfg\{info-rule\}}}\cw{\\cfg\{info-rule\}\{}\e{text}\cw{\}}[\cw{\{}\e{text}\cw{\}}...]
1384
1385\dd Specifies the text used to draw \i{horizontal rules}. You can
1386specify multiple fallback options. Works exactly like the
1387\cw{\\cfg\{text-rule\}} directive (see \k{output-text-characters}).
1388
1389\dt \I{\cw{\\cfg\{info-quotes\}}}\cw{\\cfg\{info-quotes\}\{}\e{open-quote}\cw{\}\{}\e{close-quote}\cw{\}}[\cw{\{}\e{open-quote}\cw{\}\{}\e{close-quote}...\cw{\}}]
1390
6069815a 1391\dd Specifies the quotation marks to use, overriding any
1392\cw{\\cfg\{quotes\}} directive. You can specify multiple
5b1d0032 1393fallback options. Works exactly like the \cw{\\cfg\{text-quotes\}}
1394directive (see \k{output-text-characters}).
1395
1396\dt \I{\cw{\\cfg\{info-emphasis\}}}\cw{\\cfg\{info-emphasis\}\{}\e{start-emph}\cw{\}\{}\e{end-emph}\cw{\}}[\cw{\{}\e{start-emph}\cw{\}\{}\e{end-emph}...\cw{\}}]
1397
1398\dd Specifies how to display emphasised text. You can specify
1399multiple fallback options. Works exactly like the
1400\cw{\\cfg\{text-emphasis\}} directive (see
1401\k{output-text-characters}).
1402
6b4dfd74 1403\S{output-info-misc} Miscellaneous configuration options
1404
5b1d0032 1405\dt \I{\cw{\\cfg\{info-list-suffix\}}}\cw{\\cfg\{info-list-suffix\}\{}\e{text}\cw{\}}
1406
1407\dd Specifies the text to append to the item numbers in a
1408\i{numbered list}. Works exactly like the
1409\cw{\\cfg\{text-list-suffix\}} directive (see
1410\k{output-text-misc}).
1411
43f61c25 1412\dt \I{\cw{\\cfg\{info-dir-entry\}}}\cw{\\cfg\{info-dir-entry\}\{}\e{section}\cw{\}\{}\e{short
1413name}\cw{\}\{}\e{long name}\cw{\}}[\cw{\{}\e{keyword}\cw{\}}]
1414
1415\dd Constructs an \i\cw{INFO-DIR-ENTRY} section and places it in the
1416header of the Info file. This mechanism is used to automatically
1417generate the \i{\c{dir} file} at the root of a Unix system's
1418\c{info} collection.
1419
1420\lcont{
1421
1422The parameters to this directive are:
1423
1424\dt \e{section}
1425
1426\dd Specifies the section of the \c{dir} file in which you want your
1427document referenced. For example, \q{Development}, or \q{Games}, or
1428\q{Miscellaneous}.
1429
1430\dt \e{short name}
1431
1432\dd Specifies a short name for the directory entry, which will
1433appear at the start of the menu line.
1434
1435\dt \e{long name}
1436
1437\dd Specifies a long name for the directory entry, which will appear
1438at the end of the menu line.
1439
1440\dt \e{keyword}
1441
1442\dd This parameter is optional. If it is present, then the directory
1443entry will cause a jump to a particular subsection of your document,
1444rather than starting at the top. The subsection will be the one
1445referred to by the given keyword (see \k{input-sections} for details
1446about assigning keywords to document sections).
1447
1448For example, in a document describing many game programs, the
1449configuration directive
1450
fc8e7adb 1451\c \cfg{info-dir-entry}{Games}{Chess}{Electronic chess
1452\c game}{chess}
43f61c25 1453
1454might produce text in the \c{dir} file looking something like this:
1455
1456\c Games
1457\c * Chess: (mygames)Chapter 3. Electronic chess game
1458
1459if the output file were called \c{mygames.info} and the keyword
1460\c{chess} had been used to define Chapter 3 of the document.
1461
1462}
0287083a 1463
6b4dfd74 1464\S{output-info-defaults} Default settings
1465
5b1d0032 1466The \i{default settings} for the \c{info} output format are:
1467
1468\c \cfg{info-filename}{output.info}
6b4dfd74 1469\c \cfg{info-max-file-size}{65536}
5b1d0032 1470\c
1471\c \cfg{info-width}{70}
1472\c \cfg{info-indent-code}{2}
1473\c \cfg{info-index-width}{40}
1474\c \cfg{info-list-indent}{1}
1475\c \cfg{info-listitem-indent}{3}
9ec43d08 1476\c
5b1d0032 1477\c \cfg{info-section-suffix}{: }
5b1d0032 1478\c \cfg{info-underline}{\u203e}{-}
6b4dfd74 1479\c
1480\c \cfg{info-charset}{ASCII}
5b1d0032 1481\c \cfg{info-bullet}{\u2022}{-}
1482\c \cfg{info-rule}{\u2500}{-}
1483\c \cfg{info-quotes}{\u2018}{\u2019}{`}{'}
1484\c \cfg{info-emphasis}{_}{_}
1485\c
1486\c \cfg{info-list-suffix}{.}
5b1d0032 1487
1488and no \cw{\\cfg\{info-dir-entry\}} directives.
1489
9ec43d08 1490\H{output-paper} Paper formats
1491
4d26571f 1492These output formats (currently PDF and PostScript) generate printable
9ec43d08 1493manuals. As such, they share a number of configuration directives.
1494
9ec43d08 1495\S{output-pdf} \i{PDF}
0287083a 1496
bd7010ae 1497This output format generates a printable manual in PDF format. In
1498addition, it uses some PDF interactive features to
0287083a 1499provide an outline of all the document's sections and clickable
1500cross-references between sections.
1501
9ec43d08 1502There is one configuration option specific to PDF:
0287083a 1503
1504\dt \I{\cw{\\cfg\{pdf-filename\}}}\cw{\\cfg\{pdf-filename\}\{}\e{filename}\cw{\}}
1505
1506\dd Sets the \i{output file name} in which to store the PDF file.
1507This directive is implicitly generated if you provide a file name
1508parameter after the command-line option \i\c{--pdf} (see
1509\k{running-options}).
1510
1511The \i{default settings} for the PDF output format are:
1512
1513\c \cfg{pdf-filename}{output.pdf}
9ec43d08 1514
bd7010ae 1515\S{output-ps} \i{PostScript}
1516
1517This output format generates a printable manual in PostScript format.
1518This should look exactly identical to the PDF output (see
1519\k{output-ps}), and uses \i\c{pdfmark} to arrange that if converted
1520to PDF it will contain the same interactive features.
1521
1522There is one configuration option specific to PostScript:
1523
1524\dt \I{\cw{\\cfg\{ps-filename\}}}\cw{\\cfg\{ps-filename\}\{}\e{filename}\cw{\}}
1525
1526\dd Sets the \i{output file name} in which to store the PostScript
1527file. This directive is implicitly generated if you provide a file
1528name parameter after the command-line option \i\c{--ps} (see
1529\k{running-options}).
1530
1531The \i{default settings} for the PostScript output format are:
1532
1533\c \cfg{ps-filename}{output.ps}
1534
9ec43d08 1535\S{output-paper-dimensions} Configuring layout and \i{measurements}
1536
1537All measurements are in PostScript \i{points} (72 points to the inch).
1538
1539\S2{output-paper-pagesize} Page properties
1540
1541\dt \I{\cw{\\cfg\{paper-page-width\}}}\cw{\\cfg\{paper-page-width\}\{}\e{points}\cw{\}}
1542
1543\dt \I{\cw{\\cfg\{paper-page-height\}}}\cw{\\cfg\{paper-page-height\}\{}\e{points}\cw{\}}
1544
1545\dd Specify the absolute limits of the paper.
1546
1547\dt \I{\cw{\\cfg\{paper-left-margin\}}}\cw{\\cfg\{paper-left-margin\}\{}\e{points}\cw{\}}
1548
1549\dt \I{\cw{\\cfg\{paper-top-margin\}}}\cw{\\cfg\{paper-top-margin\}\{}\e{points}\cw{\}}
1550
1551\dt \I{\cw{\\cfg\{paper-right-margin\}}}\cw{\\cfg\{paper-right-margin\}\{}\e{points}\cw{\}}
1552
1553\dt \I{\cw{\\cfg\{paper-bottom-margin\}}}\cw{\\cfg\{paper-bottom-margin\}\{}\e{points}\cw{\}}
1554
1555\dd Specify the margins. Most text appears within these margins,
1556except:
1557
1558\lcont{
1559
1560\b Section numbers, which appear in the left margin.
1561
1562\b The footer (containing page numbers), which appears in the bottom
1563margin.
1564
1565}
1566
1567\S2{output-paper-line} Vertical spacing
1568
1569\dt \I{\cw{\\cfg\{paper-base-leading\}}}\cw{\\cfg\{paper-base-leading\}\{}\e{points}\cw{\}}
1570
1571\dd Specifies the amount of space between lines of text within a
1572paragraph. (So, if the font size is 12pt and there is 2pt of leading,
1573there will be 14pt between successive baselines.)
1574
1575\dt \I{\cw{\\cfg\{paper-base-para-spacing\}}}\cw{\\cfg\{paper-base-para-spacing\}\{}\e{points}\cw{\}}
1576
1577\dd Specifies the amount of vertical space between paragraphs. (The
1578vertical space between paragraphs does \e{not} include
1579\c{paper-base-leading}.)
1580
1581\S2{output-paper-indentation} Indentation
1582
1583\dt \I{\cw{\\cfg\{paper-list-indent\}}}\cw{\\cfg\{paper-list-indent\}\{}\e{points}\cw{\}}
1584
1585\dd Specifies the indentation of the bullet or number in a
1586\I{bulletted list, indentation}bulletted or \I{numbered list,
52089152 1587indentation}numbered \I{list, indentation}list, similarly to
9ec43d08 1588\cw{\\cfg\{text-list-indent\}} (see \k{output-text-dimensions}).
1589
1590\dt \I{\cw{\\cfg\{paper-listitem-indent\}}}\cw{\\cfg\{paper-listitem-indent\}\{}\e{points}\cw{\}}
1591
1592\dd Specifies the \e{extra} indentation for the body of a list item,
1593over and above the amount configured in \cw{\\cfg\{paper-list-indent\}}.
1594
1595\# FIXME: doesn't actually work, AFAICT.
1596
1597\dt \I{\cw{\\cfg\{paper-quote-indent\}}}\cw{\\cfg\{paper-quote-indent\}\{}\e{points}\cw{\}}
1598
1599\dd Specifies the amount of indentation for a level of quoting. Used
1600for \cw{\\quote} (see \k{input-quote}) and code quotes with \cw{\\c}
1601(see \k{input-code}).
1602
1603\S2{output-paper-headings} Headings
1604
1605\dt \I{\cw{\\cfg\{paper-chapter-top-space\}}}\cw{\\cfg\{paper-chapter-top-space\}\{}\e{points}\cw{\}}
1606
ab7d6241 1607\dd Specifies the space between the top margin and the top of the
1608chapter heading. (Each chapter begins on a new page.)
9ec43d08 1609
1610\dt \I{\cw{\\cfg\{paper-chapter-underline-thickness\}}}\cw{\\cfg\{paper-chapter-underline-thickness\}\{}\e{points}\cw{\}}
1611
1612\dd Specifies the vertical thickness of the black rule under chapter
1613headings.
1614
1615\dt \I{\cw{\\cfg\{paper-chapter-underline-depth\}}}\cw{\\cfg\{paper-chapter-underline-depth\}\{}\e{points}\cw{\}}
1616
1617\dd Specifies the distance between the base of the chapter heading and
1618the \e{base} of the underlying rule.
1619
1620\dt \I{\cw{\\cfg\{paper-sect-num-left-space\}}}\cw{\\cfg\{paper-sect-num-left-space\}\{}\e{points}\cw{\}}
1621
1622\dd Specifies the distance between the left margin and the \e{right}
1623of section numbers (which are in the left margin).
1624
1625\S2{output-paper-index} Contents and index
1626
1627\dt \I{\cw{\\cfg\{paper-contents-index-step\}}}\cw{\\cfg\{paper-contents-index-step\}\{}\e{points}\cw{\}}
1628
1629\dt \I{\cw{\\cfg\{paper-contents-margin\}}}\cw{\\cfg\{paper-contents-margin\}\{}\e{points}\cw{\}}
1630
1631\# FIXME: I do not know what dees one does. (I couldn't get either of
1632them to do anything obvious, although the source indicates they should
1633do something.)
1634
1635\dt \I{\cw{\\cfg\{paper-leader-separation\}}}\cw{\\cfg\{paper-leader-separation\}\{}\e{points}\cw{\}}
1636
1637\dd Specifies the horizontal spacing between dots in \i\e{leaders}
1638(the dotted lines that appear between section headings and page
1639numbers in the table of contents).
1640
1641\dt \I{\cw{\\cfg\{paper-footer-distance\}}}\cw{\\cfg\{paper-footer-distance\}\{}\e{points}\cw{\}}
1642
1643\dd Specifies the distance between the bottom margin and the \e{base}
1644of the footer (which contains page numbers).
1645
1646\dt \I{\cw{\\cfg\{paper-index-columns\}}}\cw{\\cfg\{paper-index-columns\}\{}\e{columns}\cw{\}}
1647
1648\dd Specifies the number of columns the index should be divided into.
1649
1650\# FIXME: with this set to 1, the right-alignment of some index entry
1651page numbers in the Halibut manual is decidedly wonky.
1652
1653\dt \I{\cw{\\cfg\{paper-index-gutter\}}}\cw{\\cfg\{paper-index-gutter\}\{}\e{points}\cw{\}}
1654
1655\dd Specifies the amount of \I{gutter} horizontal space between index
1656columns.
1657
1658\dt \I{\cw{\\cfg\{paper-index-minsep\}}}\cw{\\cfg\{paper-index-minsep\}\{}\e{points}\cw{\}}
1659
1660\dd Specifies the minimum allowable horizontal space between an index
1661entry and its page number. If the gap is smaller, the page number is
1662moved to the next line.
1663
c419cb97 1664\S2{output-paper-fonts} \ii{Fonts}
1665
1666The directives in this section control which fonts Halibut uses for
1667various kinds of text. Directives for setting the font normally take
1668three font names, the first of which is used for normal text, the
1669second for emphasised text, and the third for code. Any fonts which
1670aren't specified are left unchanged. Fonts are named using their
ea63f6f9 1671PostScript names.
1672
1673Halibut intrinsically knows about some fonts, and these fonts are also
1674built into all PDF and most PostScript implementations. These are:
c419cb97 1675
1676\b \cw{Times-Roman}
1677
1678\b \cw{Times-Italic}
1679
1680\b \cw{Times-Bold}
1681
1682\b \cw{Times-BoldItalic}
1683
1684\b \cw{Helvetica}
1685
1686\b \cw{Helvetica-Oblique}
1687
1688\b \cw{Helvetica-Bold}
1689
1690\b \cw{Helvetica-BoldOblique}
1691
1692\b \cw{Courier}
1693
1694\b \cw{Courier-Oblique}
1695
1696\b \cw{Courier-Bold}
1697
1698\b \cw{Courier-BoldOblique}
1699
3e2dd889 1700These fonts can be used without further formality. To use any other
1701font, Halibut needs at least to know its measurements, which are
1702provided in an \i{Adobe Font Metrics} (\I{AFM files}AFM) file.
1703Halibut can also \I{embedding fonts}embed \i{Type 1 fonts} in its PDF
1704and PostScript output if provided with font file in either hexadecimal (\I{PFA
1705files}PFA) or IBM PC (\I{PFB files}PFB) format. To provide
1706an AFM, PFA, or PFB file to Halibut, simply name it on Halibut's command
1707line. If a PFA or PFB file is specified, the corresponding AFM file
1708must come first.
ea63f6f9 1709
c419cb97 1710\ii{Font sizes} are specified in PostScript \i{points} (72 to the inch).
1711
1712\dt \I{\cw{\\cfg\{paper-title-fonts\}}}\cw{\\cfg\{paper-title-fonts\}\{}\e{normal-font}\cw{\}}[\cw{\{}\e{emph-font}\cw{\}}[\cw{\{}\e{code-font}\cw{\}}]]
1713
1714\dd Specifies the fonts to use for text in the document title.
1715
1716\dt \I{\cw{\\cfg\{paper-title-font-size\}}}\cw{\\cfg\{paper-title-font-size\}\{}\e{points}\cw{\}}
1717
1718\dd Specifies the \i{font size} of the document title.
1719
1720\dt \I{\cw{\\cfg\{paper-chapter-fonts\}}}\cw{\\cfg\{paper-chapter-fonts\}\{}\e{normal-font}\cw{\}}[\cw{\{}\e{emph-font}\cw{\}}[\cw{\{}\e{code-font}\cw{\}}]]
1721
1722\dd Specifies the fonts to use for text in chapter titles.
1723
1724\dt \I{\cw{\\cfg\{paper-chapter-font-size\}}}\cw{\\cfg\{paper-chapter-font-size\}\{}\e{points}\cw{\}}
1725
1726\dd Specifies the \i{font size} of chapter titles.
1727
1728\dt \I{\cw{\\cfg\{paper-section-fonts\}}}\cw{\\cfg\{paper-section-fonts\}\{}\e{level}\cw{\}\{}\e{normal-font}\cw{\}}[\cw{\{}\e{emph-font}\cw{\}}[\cw{\{}\e{code-font}\cw{\}}]]
1729
1730\dd Specifies the fonts to use for text in section headings at the \e{level}
1731specified.
1732
1733\dt \I{\cw{\\cfg\{paper-section-font-size\}}}\cw{\\cfg\{paper-section-font-size\}\{}\e{level}\cw{\}\{}\e{points}\cw{\}}
1734
1735\dd Specifies the \i{font size} of section headings at the \e{level}
1736specified.
1737
1738\dt \I{\cw{\\cfg\{paper-base-fonts\}}}\cw{\\cfg\{paper-base-fonts\}\{}\e{normal-font}\cw{\}}[\cw{\{}\e{emph-font}\cw{\}}[\cw{\{}\e{code-font}\cw{\}}]]
1739
1740\dd Specifies the fonts to use for text in the body text.
9ec43d08 1741
1742\dt \I{\cw{\\cfg\{paper-base-font-size\}}}\cw{\\cfg\{paper-base-font-size\}\{}\e{points}\cw{\}}
1743
c419cb97 1744\dd Specifies the \i{font size} of body text.
1745
1746\dt \I{\cw{\\cfg\{paper-code-fonts\}}}\cw{\\cfg\{paper-code-fonts\}\{}\e{bold-font}\cw{\}}[\cw{\{}\e{italic-font}\cw{\}}[\cw{\{}\e{normal-font}\cw{\}}]]
1747
1748\dd Specifies the fonts to use for text in code paragraps. The
1749\e{bold-font} is used for bold text, the \e{italic-font} for
1750emphasised text, and the \e{normal-font} for normal code.
9ec43d08 1751
c419cb97 1752\dt \I{\cw{\\cfg\{paper-code-font-size\}}}\cw{\\cfg\{paper-code-font-size\}\{}\e{points}\cw{\}}
1753
1754\dd Specifies the \i{font size} of text in code paragraphs.
9ec43d08 1755
1756\dt \I{\cw{\\cfg\{paper-pagenum-font-size\}}}\cw{\\cfg\{paper-pagenum-font-size\}\{}\e{points}\cw{\}}
1757
c419cb97 1758\dd Specifies the font size to use for \i{page numbers}.
9ec43d08 1759
1760\S2{output-paper-misc} Miscellaneous
1761
1762\dt \I{\cw{\\cfg\{paper-rule-thickness\}}}\cw{\\cfg\{paper-rule-thickness\}\{}\e{points}\cw{\}}
1763
1764\dd Specifies the vertical thickness of the rule produced by the
1765\cw{\\rule} command (see \k{input-rule}). (Note that no extra space is
1766reserved for thicker rules.)
1767
1768\S{output-paper-characters} Configuring the characters used
1769
1770\dt \I{\cw{\\cfg\{paper-bullet\}}}\cw{\\cfg\{paper-bullet\}\{}\e{text}\cw{\}}[\cw{\{}\e{text}\cw{\}}...]
1771
1772\dd Specifies the text to use as the \i{bullet} in bulletted lists.
1773You can specify multiple fallback options. Works exactly like the
1774\cw{\\cfg\{text-bullet\}} directive (see
1775\k{output-text-characters}).
1776
1777\dt \I{\cw{\\cfg\{paper-quotes\}}}\cw{\\cfg\{paper-quotes\}\{}\e{open-quote}\cw{\}\{}\e{close-quote}\cw{\}}[\cw{\{}\e{open-quote}\cw{\}\{}\e{close-quote}...\cw{\}}]
1778
1779\dd Specifies the quotation marks to use, overriding any
1780\cw{\\cfg\{quotes\}} directive. You can specify multiple
1781fallback options. Works exactly like the \cw{\\cfg\{text-quotes\}}
1782directive (see \k{output-text-characters}).
1783
1784\S{output-paper-defaults} Default settings for paper formats
1785
1786The default page size corresponds to 210\_\u00D7{x}\_297\_mm, i.e.,
1787\i{A4 paper}.
1788
1789\c \cfg{paper-page-width}{595}
30ddbdc1 1790\c \cfg{paper-page-height}{842}
9ec43d08 1791\c
1792\c \cfg{paper-left-margin}{72}
1793\c \cfg{paper-top-margin}{72}
1794\c \cfg{paper-right-margin}{72}
1795\c \cfg{paper-bottom-margin}{108}
1796\c
1797\c \cfg{paper-base-leading}{1}
1798\c \cfg{paper-base-para-spacing}{10}
1799\c
1800\c \cfg{paper-list-indent}{6}
1801\c \cfg{paper-listitem-indent}{18}
1802\c \cfg{paper-quote-indent}{18}
1803\c
1804\c \cfg{paper-chapter-top-space}{72}
1805\c \cfg{paper-chapter-underline-thickness}{3}
1806\c \cfg{paper-chapter-underline-depth}{14}
1807\c \cfg{paper-sect-num-left-space}{12}
1808\c
1809\c \cfg{paper-contents-index-step}{24}
1810\c \cfg{paper-contents-margin}{84}
1811\c \cfg{paper-leader-separation}{12}
1812\c \cfg{paper-footer-distance}{32}
1813\c \cfg{paper-index-columns}{2}
1814\c \cfg{paper-index-gutter}{36}
1815\c \cfg{paper-index-minsep}{18}
1816\c
c419cb97 1817\c \cfg{paper-base-fonts}{Times-Roman}{Times-Italic}{Courier}
9ec43d08 1818\c \cfg{paper-base-font-size}{12}
c419cb97 1819\c \cfg{paper-code-fonts}{Courier-Bold}{Courier-Oblique}{Courier}
1820\c \cfg{paper-code-font-size}{12}
056ab80e 1821\c \cfg{paper-title-fonts}{Helvetica-Bold}
1822\c {Helvetica-BoldOblique}{Courier-Bold}
c419cb97 1823\c \cfg{paper-title-font-size}{24}
056ab80e 1824\c \cfg{paper-chapter-fonts}{Helvetica-Bold}
1825\c {Helvetica-BoldOblique}{Courier-Bold}
c419cb97 1826\c \cfg{paper-chapter-font-size}{20}
056ab80e 1827\c \cfg{paper-section-fonts}{0}{Helvetica-Bold}
1828\c {Helvetica-BoldOblique}{Courier-Bold}
c419cb97 1829\c \cfg{paper-section-font-size}{0}{16}
056ab80e 1830\c \cfg{paper-section-fonts}{1}{Helvetica-Bold}
1831\c {Helvetica-BoldOblique}{Courier-Bold}
c419cb97 1832\c \cfg{paper-section-font-size}{1}{14}
056ab80e 1833\c \cfg{paper-section-fonts}{2}{Helvetica-Bold}
1834\c {Helvetica-BoldOblique}{Courier-Bold}
c419cb97 1835\c \cfg{paper-section-font-size}{2}{13}
1836\c ... and so on for all section levels below this ...
1837\e iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
1838\c
9ec43d08 1839\c \cfg{paper-pagenum-font-size}{12}
1840\c
1841\c \cfg{paper-rule-thickness}{1}
1842\c
1843\c \cfg{paper-bullet}{\u2022}{-}
1844\c \cfg{paper-quotes}{\u2018}{\u2019}{'}{'}