Ahem; let's have all the man page headings at the same level!
[sgt/halibut] / doc / output.but
1 \C{output} Halibut output formats
2
3 This chapter describes each of Halibut's current \i{output formats}.
4 It gives some general information about the format, and also
5 describes all the \i{configuration directives} which are specific to
6 that format.
7
8 \H{output-text} Plain text
9
10 This output format generates the document as a single \i{plain text}
11 file.
12
13 The output file is currently assumed to be in the \i{ISO 8859-1}
14 character set. Any Unicode characters representable in this set will
15 be output verbatim; any other characters will not be output and
16 their \i{fallback text} (if any) will be used instead.
17
18 The precise formatting of the text file can be controlled by a
19 variety of configuration directives. They are listed in the
20 following subsections.
21
22 \S{output-text-file} Output file name
23
24 \dt \I{\cw{\\cfg\{text-filename\}}}\cw{\\cfg\{text-filename\}\{}\e{filename}\cw{\}}
25
26 \dd Sets the \i{output file name} in which to store the text file.
27 This directive is implicitly generated if you provide a file name
28 parameter after the command-line option \i\c{--text} (see
29 \k{running-options}).
30
31 \S{output-text-dimensions} Indentation and line width
32
33 This section describes the configuration directives which control
34 the \i{horizontal dimensions} of the output text file: how much
35 paragraphs are indented by and how long the lines are.
36
37 \dt \I{\cw{\\cfg\{text-width\}}}\cw{\\cfg\{text-width\}\{}\e{width}\cw{\}}
38
39 \dd Sets the \I{text width}width of the main part of the document,
40 in characters. This width will be used for wrapping paragraphs and
41 for centring titles (if you have asked for titles to be centred -
42 see \k{output-text-headings}). This width does \e{not} include the
43 left indentation set by \cw{\\cfg\{text-indent\}}; if you specify an
44 indent of 8 and a width of 64, your maximum output line length will
45 be 72.
46
47 \dt \I{\cw{\\cfg\{text-indent\}}}\cw{\\cfg\{text-indent\}\{}\e{indent}\cw{\}}
48
49 \dd Sets the left \i{indentation} for the document. If you set this
50 to zero, your document will look like an ordinary text file as
51 someone with a text editor might have written it; if you set it
52 above zero, the text file will have a \i{margin} down the left in
53 the style of some printed manuals, and you can then configure the
54 section numbers to appear in this margin (see
55 \k{output-text-headings}).
56
57 \dt \I{\cw{\\cfg\{text-indent-code\}}}\cw{\\cfg\{text-indent-code\}\{}\e{indent}\cw{\}}
58
59 \dd Specifies how many extra characters of indentation (on top of
60 the normal left indent) should be given to \I{code paragraphs,
61 indentation} code paragraphs.
62
63 \dt \I{\cw{\\cfg\{text-list-indent\}}}\cw{\\cfg\{text-list-indent\}\{}\e{indent}\cw{\}}
64
65 \dd Specifies how many extra spaces should be used to indent the
66 bullet or number in a \I{bulletted list, indentation}bulletted or
67 \I{numbered list, indentation}numbered \I{list, indentation}list.
68 The actual body of the list item will be indented by this much
69 \e{plus} the value configured by \cw{\\cfg\{text-listitem-indent\}}.
70
71 \dt \I{\cw{\\cfg\{text-listitem-indent\}}}\cw{\\cfg\{text-listitem-indent\}\{}\e{indent}\cw{\}}
72
73 \dd Specifies how many extra spaces should be used to indent the
74 body of a list item, over and above the number configured in
75 \cw{\\cfg\{text-list-indent\}}.
76
77 \dt \I{\cw{\\cfg\{text-indent-preamble\}}}\cw{\\cfg\{text-indent-preamble\}\{}\e{boolean}\cw{\}}
78
79 \dd When this is set to \c{true}, the document \i{preamble} (i.e. any
80 paragraphs appearing before the first chapter heading) will be
81 indented to the level specified by \cw{\\cfg\{text-indent\}}. If
82 this setting is \c{false}, the document preamble will not be
83 indented at all from the left margin.
84
85 \S{output-text-headings} \ii{Configuring heading display}
86
87 The directives in this section allow you to configure the appearance
88 of the title, chapter and section headings in your text file.
89
90 Several of the directives listed below specify the \i{alignment} of
91 a heading. These alignment options have three possible values:
92
93 \dt \i\c{left}
94
95 \dd Align the heading to the very left of the text file (column zero).
96
97 \dt \i\c{leftplus}
98
99 \dd Align the section title to the left of the main display region
100 (in other words, indented to the level specified by
101 \cw{\\cfg\{text-indent\}}). The section \e{number} is placed to the
102 left of that (so that it goes in the margin if there is room).
103
104 \dt \i\c{centre}
105
106 \dd Centre the heading.
107
108 Also, several of the directives below specify how a title should be
109 \I{underlining}underlined. The parameter to one of these directives
110 should be either blank (\cw{\{\}}) or a single character. In the
111 latter case, that character will be used to underline the title. So
112 you might want to specify, for example,
113 \cw{\\text-title-underline\{=\}} but
114 \cw{\\text-chapter-underline\{-\}}.
115
116 \dt \I{\cw{\\cfg\{text-title-align\}}}\cw{\\cfg\{text-title-align\}\{}\e{alignment}\cw{\}}
117
118 \dd Specifies the alignment of the overall document title: \c{left},
119 \c{leftplus} or \c{centre}.
120
121 \dt \I{\cw{\\cfg\{text-title-underline\}}}\cw{\\cfg\{text-title-underline\}\{}\e{underline-character}\cw{\}}
122
123 \dd Specifies how the overall document title should be underlined.
124
125 \dt \I{\cw{\\cfg\{text-chapter-align\}}}\cw{\\cfg\{text-chapter-align\}\{}\e{alignment}\cw{\}}
126
127 \dd Specifies the alignment of chapter and appendix headings.
128
129 \dt \I{\cw{\\cfg\{text-chapter-underline\}}}\cw{\\cfg\{text-chapter-underline\}\{}\e{underline-character}\cw{\}}
130
131 \dd Specifies how chapter and appendix headings should be underlined.
132
133 \dt \I{\cw{\\cfg\{text-chapter-numeric\}}}\cw{\\cfg\{text-chapter-numeric\}\{}\e{boolean}\cw{\}}
134
135 \dd If this is set to \c{true}, then chapter headings will not
136 contain the word \q{Chapter} (or whatever other word you have
137 defined in its place - see \k{input-sections} and \k{input-config});
138 they will just contain the chapter \e{number}, followed by the
139 chapter title. If you set this to \c{false}, chapter headings will
140 be prefixed by \q{Chapter} or equivalent.
141
142 \dt \I{\cw{\\cfg\{text-chapter-suffix\}}}\cw{\\cfg\{text-chapter-suffix\}\{}\e{text}\cw{\}}
143
144 \dd This specifies the suffix text to be appended to the chapter
145 number, before displaying the chapter title. For example, if you set
146 this to \q{\cw{:\_}}, then the chapter title might look something
147 like \q{Chapter 2: Doing Things}.
148
149 \dt \I{\cw{\\cfg\{text-section-align\}}}\cw{\\cfg\{text-section-align\}\{}\e{level}\cw{\}\{}\e{alignment}\cw{\}}
150
151 \dd Specifies the alignment of section headings at a particular
152 level. The \e{level} parameter specifies which level of section
153 headings you want to affect: 0 means first-level headings (\c{\\H}),
154 1 means second-level headings (\c{\\S}), 2 means the level below
155 that (\c{\\S2}), and so on. The \e{alignment} parameter is treated
156 just like the other alignment directives listed above.
157
158 \dt \I{\cw{\\cfg\{text-section-underline\}}}\cw{\\cfg\{text-section-underline\}\{}\e{level}\cw{\}\{}\e{underline-character}\cw{\}}
159
160 \dd Specifies how to underline section headings at a particular level.
161
162 \dt \I{\cw{\\cfg\{text-section-numeric\}}}\cw{\\cfg\{text-section-numeric\}\{}\e{level}\cw{\}\{}\e{boolean}\cw{\}}
163
164 \dd Specifies whether section headings at a particular level should
165 contain the word \q{Section} or equivalent (if \c{false}), or should
166 be numeric only (if \c{true}).
167
168 \dt \I{\cw{\\cfg\{text-section-suffix\}}}\cw{\\cfg\{text-section-suffix\}\{}\e{level}\cw{\}\{}\e{text}\cw{\}}
169
170 \dd Specifies the \I{suffix text, in section titles}suffix text to
171 be appended to section numbers at a particular level, before
172 displaying the section title.
173
174 \S{output-text-misc} Miscellaneous configuration options
175
176 \dt \I{\cw{\\cfg\{text-versionid\}}}\cw{\\cfg\{text-versionid\}\{}\e{boolean}\cw{\}}
177
178 \dd If this is set to \c{true}, \i{version ID paragraphs} (defined
179 using the \i\c{\\versionid} command - see \k{input-blurb}) will be
180 included at the bottom of the text file. If it is set to \c{false},
181 they will be omitted completely.
182
183 \dt \I{\cw{\\cfg\{text-bullet\}}}\cw{\\cfg\{text-bullet\}\{}\e{text}\cw{\}}
184
185 \dd This specifies the text which should be used as the \i{bullet}
186 in bulletted lists. It can be one character
187 (\cw{\\cfg\{text-bullet\}\{-\}}), or more than one
188 (\cw{\\cfg\{text-bullet\}\{(*)\}}).
189
190 \# FIXME: code indentation is configurable, therefore \quote
191 \# indentation probably ought to be as well.
192
193 \# FIXME: text-indent-* should be consistently named.
194
195 \S{output-text-defaults} Default settings
196
197 The \i{default settings} for Halibut's plain text output format are:
198
199 \c \cfg{text-filename}{output.txt}
200 \c
201 \c \cfg{text-width}{68}
202 \c \cfg{text-indent}{7}
203 \c \cfg{text-indent-code}{2}
204 \c \cfg{text-list-indent}{1}
205 \c \cfg{text-listitem-indent}{3}
206 \c \cfg{text-indent-preamble}{false}
207 \c
208 \c \cfg{text-title-align}{centre}
209 \c \cfg{text-title-underline}{=}
210 \c
211 \c \cfg{text-chapter-align}{left}
212 \c \cfg{text-chapter-underline}{-}
213 \c \cfg{text-chapter-numeric}{false}
214 \c \cfg{text-chapter-suffix}{: }
215 \c
216 \c \cfg{text-section-align}{0}{leftplus}
217 \c \cfg{text-section-underline}{0}{}
218 \c \cfg{text-section-numeric}{0}{true}
219 \c \cfg{text-section-suffix}{0}{ }
220 \c
221 \c \cfg{text-section-align}{1}{leftplus}
222 \c \cfg{text-section-underline}{1}{}
223 \c \cfg{text-section-numeric}{1}{true}
224 \c \cfg{text-section-suffix}{1}{ }
225 \c
226 \c ... and so on for all section levels below this ...
227 \e iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
228
229 \H{output-html} HTML
230
231 This output format generates an \i{HTML} version of the document. By
232 default, this will be in multiple files, starting with
233 \c{Contents.html} and splitting the document into files by chapter
234 and/or subsection. You can configure precisely how the text is split
235 between HTML files using the configuration commands described in
236 this section. In particular, you can configure Halibut to output one
237 single HTML file instead of multiple ones.
238
239 Strictly speaking, the output format is \i{XHTML} 1.0 Transitional,
240 which is why all of the configuration directives start with the word
241 \c{xhtml} rather than \c{html}.
242
243 \S{output-html-file} Controlling the output file names
244
245 \dt \I{\cw{\\cfg\{xhtml-contents-filename\}}}\cw{\\cfg\{xhtml-contents-filename\}\{}\e{filename}\cw{\}}
246
247 \dd Sets the \i{output file name} in which to store the top-level
248 contents page. Since this is the first page a user ought to see when
249 beginning to read the document, a good choice in many cases might be
250 \c{index.html} (but this is not the default, for historical
251 reasons).
252
253 \dt \I{\cw{\\cfg\{xhtml-index-filename\}}}\cw{\\cfg\{xhtml-index-filename\}\{}\e{filename}\cw{\}}
254
255 \dd Sets the file name in which to store the document's index.
256
257 \dt \I{\cw{\\cfg\{xhtml-template-filename\}}}\cw{\\cfg\{xhtml-template-filename\}\{}\e{template}\cw{\}}
258
259 \dd Provides a \i{template} to be used when constructing the file
260 names of each chapter or section of the document. This template
261 should contain at least one \i\e{formatting command}, in the form of
262 a per cent sign followed by a letter. (If you need a literal per
263 cent sign, you can write \c{%%}.)
264
265 \lcont{
266
267 The formatting commands used in this template are:
268
269 \dt \i\c{%N}
270
271 \dd Expands to the visible title of the section, with white space
272 removed. So in a chapter declared as \q{\cw{\\C\{fish\} Catching
273 Fish}}, this formatting command would expand to
274 \q{\cw{CatchingFish}}.
275
276 \dt \i\c{%n}
277
278 \dd Expands to the type and number of the section, without white
279 space. So in chapter 1 this would expand to \q{\cw{Chapter1}}; in
280 section A.4.3 it would expand to \q{\cw{SectionA.4.3}}, and so on.
281 If the section has no number (an unnumbered chapter created using
282 \c{\\U}), this directive falls back to doing the same thing as
283 \c{%N}.
284
285 \dt \i\c{%b}
286
287 \dd Expands to the bare number of the section. So in chapter 1 this
288 would expand to \q{\cw{1}}; in section A.4.3 it would expand to
289 \q{\cw{A.4.3}}, and so on. If the section has no number (an
290 unnumbered chapter created using \c{\\U}), this directive falls back
291 to doing the same thing as \c{%N}.
292
293 \dt \i\c{%k}
294
295 \dd Expands to the internal keyword specified in the section title.
296 So in a chapter declared as \q{\cw{\\C\{fish\} Catching Fish}}, this
297 formatting command would expand to \q{\cw{fish}}. If the section has
298 no keyword (an unnumbered chapter created using \c{\\U}), this
299 directive falls back to doing the same thing as \c{%N}.
300
301 These formatting directives can also be used in the
302 \cw{\\cfg\{xhtml-template-fragment\}} configuration directive (see
303 \k{output-html-misc}).
304
305 }
306
307 \dt \I{\cw{\\cfg\{xhtml-single-filename\}}}\cw{\\cfg\{xhtml-single-filename\}\{}\e{filename}\cw{\}}
308
309 \dd Sets the file name in which to store the entire document, if
310 Halibut is configured (using \c{\\cfg\{xhtml-leaf-level\}\{0\}} to
311 produce a single self-contained file. Both this directive \e{and}
312 \c{\\cfg\{xhtml-leaf-level\}\{0\}} are implicitly generated if you
313 provide a file name parameter after the command-line option
314 \i\c{--html} (see \k{running-options}).
315
316 \S{output-html-split} Controlling the splitting into HTML files
317
318 By default, the HTML output from Halibut is split into multiple
319 files. Each file typically contains a single chapter or section and
320 everything below it, unless subsections of that chapter are
321 themselves split off into further files.
322
323 Most files also contain a contents section, giving hyperlinks to the
324 sections in the file and/or the sections below it.
325
326 The configuration directives listed below allow you to configure the
327 splitting into files, and the details of the contents sections.
328
329 \dt \I{\cw{\\cfg\{xhtml-leaf-level\}}}\cw{\\cfg\{xhtml-leaf-level\}\{}\e{depth}\cw{\}}
330
331 \dd This setting indicates the depth of section which should be
332 given a \I{leaf file}\q{leaf} file (a file with no sub-files). So if
333 you set it to 1, for example, then every chapter will be given its
334 own HTML file, plus a top-level \i{contents file}. If you set this
335 to 2, then each chapter \e{and} each \c{\\H} section will have a
336 file, and the chapter files will mostly just contain links to their
337 \i{sub-file}s.
338
339 \lcont{
340
341 If you set this option to zero, then the whole document will appear
342 in a single file. If you do this, Halibut will call that file
343 \i\c{Manual.html} instead of \i\c{Contents.html}.
344
345 This option is automatically set to zero if you provide a file name
346 parameter after the command-line option \i\c{--html} (see
347 \k{running-options}), because you have specified a single file name
348 and so Halibut assumes you want the whole document to be placed in
349 that file.
350
351 }
352
353 \dt \I{\cw{\\cfg\{xhtml-contents-depth\}}}\cw{\\cfg\{xhtml-contents-depth-}\e{level}\cw{\}\{}\e{depth}\cw{\}}
354
355 \dd This directive allows you to specify how \I{depth of
356 contents}deep the contents section in a particular file should go.
357
358 \lcont{
359
360 The \e{level} parameter indicates which level of contents section
361 you are dealing with. 0 denotes the main contents section in the
362 topmost file \c{Contents.html}; 1 denotes a contents section in a
363 chapter file; 2 is a contents section in a file containing a \c{\\H}
364 heading, and so on. Currently you can't go below level 5 (which
365 corresponds to a \c{\\S3} heading).
366
367 The \e{depth} parameter indicates the maximum depth of heading which
368 will be shown in this contents section. Again, 1 denotes a chapter,
369 2 is a \c{\\H} heading, 3 is a \c{\\S} heading, and so on.
370
371 So, for example: \cw{\\cfg\{xhtml-contents-depth-1\}\{3\}} instructs
372 Halibut to put contents links in chapter files for all sections down
373 to \c{\\S} level, but not to go into any more detail than that.
374
375 }
376
377 \# FIXME: this is utterly ghastly. For a start, it should include
378 \# the level as a separate argument, like the text section config
379 \# directives. Secondly, it shouldn't be limited in depth!
380
381 \dt \I{\cw{\\cfg\{xhtml-leaf-contains-contents\}}}\cw{\\cfg\{xhtml-leaf-contains-contents\}\{}\e{boolean}\cw{\}}
382
383 \dd If you set this to \c{true}, then each leaf file will contain
384 its own contents section which summarises the text within it.
385
386 \dt \I{\cw{\\cfg\{xhtml-leaf-smallest-contents\}}}\cw{\\cfg\{xhtml-leaf-smallest-contents\}\{}\e{number}\cw{\}}
387
388 \dd Contents sections in leaf files are not output at all if they
389 contain very few entries (on the assumption that it just isn't worth
390 bothering). This directive configures the minimum number of entries
391 required in a leaf contents section to make Halibut bother
392 generating it at all.
393
394 \S{output-html-html} Including pieces of your own HTML
395
396 The directives in this section allow you to supply pieces of
397 \I{HTML}\i{verbatim HTML} code, which will be included in various
398 parts of the output files.
399
400 \dt \I{\cw{\\cfg\{xhtml-head-end\}}}\cw{\\cfg\{xhtml-head-end\}\{}\e{HTML text}\cw{\}}
401
402 \dd The text you provide in this directive is placed at the end of
403 the \i\cw{<HEAD>} section of each output HTML file. So this is a
404 good place to put, for example, a link to a \i{CSS} \i{stylesheet}.
405
406 \dt \I{\cw{\\cfg\{xhtml-body-tag\}}}\cw{\\cfg\{xhtml-body-tag\}\{}\e{HTML text}\cw{\}}
407
408 \dd The text you provide in this directive is used in place of the
409 \i\cw{<BODY>} tag in each output file. So if you wanted to define a
410 \i{background colour}, for example, you could write
411 \cw{\\cfg\{xhtml-body-tag\}\{<body bg="#123456">\}}.
412
413 \dt \I{\cw{\\cfg\{xhtml-body-start\}}}\cw{\\cfg\{xhtml-body-start\}\{}\e{HTML text}\cw{\}}
414
415 \dd The text you provide in this directive is placed at the
416 beginning of the \i\cw{<BODY>} section of each output HTML file. So
417 if you intend your HTML files to be part of a web site with a
418 standard \i{house style}, and the style needs a \i{header} at the
419 top of every page, this is where you can add that header.
420
421 \dt \I{\cw{\\cfg\{xhtml-body-end\}}}\cw{\\cfg\{xhtml-body-end\}\{}\e{HTML text}\cw{\}}
422
423 \dd The text you provide in this directive is placed at the end of
424 the \i\cw{<BODY>} section of each output HTML file. So if you intend
425 your HTML files to be part of a web site with a standard \i{house
426 style}, and the style needs a \i{footer} at the bottom of every
427 page, this is where you can add that footer.
428
429 \dt \I{\cw{\\cfg\{xhtml-address-start\}}}\cw{\\cfg\{xhtml-address-start\}\{}\e{HTML text}\cw{\}}
430
431 \dd The text you provide in this directive is placed at the
432 beginning of the \i\cw{<ADDRESS>} section at the bottom of each
433 output HTML file. This might be a good place to put authors'
434 \i{contact details}, for example.
435
436 \dt \I{\cw{\\cfg\{xhtml-address-end\}}}\cw{\\cfg\{xhtml-address-end\}\{}\e{HTML text}\cw{\}}
437
438 \dd The text you provide in this directive is placed at the end of
439 the \i\cw{<ADDRESS>} section at the bottom of each output HTML file,
440 after the version IDs (if present).
441
442 \dt \I{\cw{\\cfg\{xhtml-navigation-attributes\}}}\cw{\\cfg\{xhtml-navigation-attributes\}\{}\e{HTML attributes}\cw{\}}
443
444 \dd The text you provide in this directive is included inside the
445 \cw{<P>} tag containing the \i{navigation links} at the top of each
446 page (\i{\q{Previous}} / \i{\q{Contents}} / \i{\q{Next}}). So if you
447 wanted the navigation links to have a particular CSS style, you
448 could write
449 \cw{\\cfg\{xhtml-navigation-attributes\}\{class="foo"\}}, and the
450 navigation-links paragraph would then begin with the tag \cw{<p
451 class="foo">}.
452
453 \S{output-html-headings} \ii{Configuring heading display}
454
455 \dt \I{\cw{\\cfg\{xhtml-chapter-numeric\}}}\cw{\\cfg\{xhtml-chapter-numeric\}\{}\e{boolean}\cw{\}}
456
457 \dd If this is set to \c{true}, then chapter headings will not
458 contain the word \q{Chapter} (or whatever other word you have
459 defined in its place - see \k{input-sections} and \k{input-config});
460 they will just contain the chapter \e{number}, followed by the
461 chapter title. If you set this to \c{false}, chapter headings will
462 be prefixed by \q{Chapter} or equivalent.
463
464 \dt \I{\cw{\\cfg\{xhtml-chapter-suffix\}}}\cw{\\cfg\{xhtml-chapter-suffix\}\{}\e{text}\cw{\}}
465
466 \dd This specifies the suffix text to be appended to the chapter
467 number, before displaying the chapter title. For example, if you set
468 this to \q{\cw{:\_}}, then the chapter title might look something
469 like \q{Chapter 2: Doing Things}.
470
471 \dt \I{\cw{\\cfg\{xhtml-section-numeric\}}}\cw{\\cfg\{xhtml-section-numeric\}\{}\e{boolean}\cw{\}}
472
473 \dd Specifies whether section headings at a particular level should
474 contain the word \q{Section} or equivalent (if \c{false}), or should
475 be numeric only (if \c{true}). The \e{level} parameter specifies
476 which level of section headings you want to affect: 0 means
477 first-level headings (\c{\\H}), 1 means second-level headings
478 (\c{\\S}), 2 means the level below that (\c{\\S2}), and so on.
479
480 \dt \I{\cw{\\cfg\{xhtml-section-suffix\}}}\cw{\\cfg\{xhtml-section-suffix\}\{}\e{text}\cw{\}}
481
482 \dd Specifies the suffix text to be appended to section numbers at a
483 particular level, before displaying the section title.
484
485 \S{output-html-misc} Miscellaneous options
486
487 \dt \I{\cw{\\cfg\{xhtml-template-fragment\}}}\cw{\\cfg\{xhtml-template-fragment\}\{}\e{template}\cw{\}}
488
489 \dd This directive lets you specify a \i{template}, with exactly the
490 same syntax used in \cw{\\cfg\{xhtml-template-filename\}} (see
491 \k{output-html-file}), to be used for the anchor names (\i\cw{A
492 NAME="..."}) used to allow URLs to refer to specific sections within
493 a particular HTML file. So if you set this to \q{\cw{%k}}, for
494 example, then each individual section in your document will be
495 addressable by means of a URL ending in a \c{#} followed by your
496 internal section keyword.
497
498 \dt \I{\cw{\\cfg\{xhtml-versionid\}}}\cw{\\cfg\{xhtml-versionid\}\{}\e{boolean}\cw{\}}
499
500 \dd If this is set to \c{true}, \i{version ID paragraphs} (defined using
501 the \i\c{\\versionid} command - see \k{input-blurb}) will be included
502 visibly in the \i\cw{<ADDRESS>} section at the bottom of each HTML
503 file. If it is set to \c{false}, they will be omitted completely.
504
505 \# FIXME: surely it would be better to include them in HTML
506 \# comments? The only question is whether they should be _visible_.
507
508 \dt \I{\cw{\\cfg\{xhtml-suppress-address\}}}\cw{\\cfg\{xhtml-suppress-address\}\{}\e{boolean}\cw{\}}
509
510 \dd If this is set to \c{true}, the \i\cw{<ADDRESS>} section at the
511 bottom of each HTML file will be omitted completely. (This will
512 therefore also cause \i{version IDs} not to be included.)
513
514 \dt \I{\cw{\\cfg\{xhtml-author\}}}\cw{\\cfg\{xhtml-author\}\{}\e{text}\cw{\}}
515
516 \dd The text supplied here goes in a \I{\cw{<META>} tags}\cw{<META
517 name="author">} tag in the output HTML files, so that browsers which
518 support this can automatically identify the \i{author} of the document.
519
520 \dt \I{\cw{\\cfg\{xhtml-description\}}}\cw{\\cfg\{xhtml-description\}\{}\e{text}\cw{\}}
521
522 \dd The text supplied here goes in a \I{\cw{<META>} tags}\cw{<META
523 name="description">} tag in the output HTML files, so that browsers
524 which support this can easily pick out a brief \I{description, of
525 document}description of the document.
526
527 \S{output-html-defaults} Default settings
528
529 The \i{default settings} for Halibut's HTML output format are:
530
531 \c \cfg{xhtml-contents-filename}{Contents.html}
532 \c \cfg{xhtml-index-filename}{IndexPage.html}
533 \c \cfg{xhtml-template-filename}{%n.html}
534 \c \cfg{xhtml-single-filename}{Manual.html}
535 \c \cfg{xhtml-template-fragment}{%b}
536 \c
537 \c \cfg{xhtml-leaf-level}{2}
538 \c \cfg{xhtml-leaf-contains-contents}{false}
539 \c \cfg{xhtml-leaf-smallest-contents}{4}
540 \c \cfg{xhtml-contents-depth-0}{2}
541 \c \cfg{xhtml-contents-depth-1}{3}
542 \c \cfg{xhtml-contents-depth-2}{4}
543 \c \cfg{xhtml-contents-depth-3}{5}
544 \c \cfg{xhtml-contents-depth-4}{6}
545 \c \cfg{xhtml-contents-depth-5}{7}
546 \c
547 \c \cfg{xhtml-head-end}{}
548 \c \cfg{xhtml-body-tag}{<body>}
549 \c \cfg{xhtml-body-start}{}
550 \c \cfg{xhtml-body-end}{}
551 \c \cfg{xhtml-address-start}{}
552 \c \cfg{xhtml-address-end}{}
553 \c \cfg{xhtml-navigation-attributes}{}
554 \c
555 \c \cfg{xhtml-versionid}{true}
556 \c \cfg{xhtml-suppress-address}{false}
557 \c \cfg{xhtml-author}{}
558 \c \cfg{xhtml-description}{}
559 \c
560 \c \cfg{xhtml-chapter-numeric}{false}
561 \c \cfg{xhtml-chapter-suffix}{: }
562 \c
563 \c \cfg{xhtml-section-numeric}{0}{true}
564 \c \cfg{xhtml-section-suffix}{0}{ }
565 \c
566 \c \cfg{xhtml-section-numeric}{1}{true}
567 \c \cfg{xhtml-section-suffix}{1}{ }
568 \c
569 \c ... and so on for all section levels below this ...
570 \e iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
571
572 \H{output-whlp} Windows Help
573
574 This output format generates data that can be used by the \i{Windows
575 Help} program \cw{WINHELP.EXE}. There are two actual files
576 generated, one ending in \c{.hlp} and the other ending in \c{.cnt}.
577
578 The Windows Help output format supports the following configuration
579 directives:
580
581 \dt \I{\cw{\\cfg\{winhelp-filename\}}}\cw{\\cfg\{winhelp-filename\}\{}\e{filename}\cw{\}}
582
583 \dd Sets the \i{output file name} in which to store the man page.
584 This directive is implicitly generated if you provide a file name
585 parameter after the command-line option \i\c{--winhelp} (see
586 \k{running-options}).
587
588 \lcont{
589
590 Your output file name should end with \c{.hlp}; if it doesn't,
591 Halibut will append it. Halibut will also generate a contents file
592 (ending in \c{.cnt}) alongside the file name you specify.
593
594 }
595
596 \dt \I{\cw{\\cfg\{winhelp-topic\}}}\cw{\\cfg\{winhelp-topic\}\{}\e{topic-name}\cw{\}}
597
598 \dd This directive defines a Windows \i{Help topic} name in the current
599 section. Topic names can be used by the program invoking
600 \cw{WINHELP.EXE} to jump straight to a particular section. So you
601 can use this for \i{context-sensitive help}.
602
603 \lcont{
604
605 For example, if you used this directive in a particular section:
606
607 \c \cfg{winhelp-topic}{savingfiles}
608
609 then a Windows application could invoke Windows Help to jump to that
610 particular section in the help file like this:
611
612 \c WinHelp(hwnd, "mydoc.hlp", HELP_COMMAND,
613 \c (DWORD)"JI(`',`savingfiles')");
614
615 You can use this configuration directive many times, in many
616 different subsections of your document, in order to define a lot of
617 different help contexts which you can use in this way.
618
619 }
620
621 The \i{default settings} for the Windows Help output format are:
622
623 \c \cfg{winhelp-filename}{output.hlp}
624
625 and no \c{\\cfg\{winhelp-topic\}} directives anywhere.
626
627 \H{output-man} Unix \cw{man} pages
628
629 This output format generates a Unix \i{\cw{man} page}. That is to say,
630 it generates \i\c{nroff} input designed to work with the \c{-mandoc}
631 macro package.
632
633 The available configuration options for this format are as follows:
634
635 \dt \I{\cw{\\cfg\{man-filename\}}}\cw{\\cfg\{man-filename\}\{}\e{filename}\cw{\}}
636
637 \dd Sets the \i{output file name} in which to store the man page.
638 This directive is implicitly generated if you provide a file name
639 parameter after the command-line option \i\c{--man} (see
640 \k{running-options}).
641
642 \dt \I{\cw{\\cfg\{man-identity\}}}\cw{\\cfg\{man-identity\}\{}\e{text}\cw{\}\{}\e{text...}\cw{\}}
643
644 \dd This directive is used to generate the initial \i{\c{.TH}
645 directive} that appears at the top of a \cw{man} page. It expects to
646 be followed by some number of brace pairs containing text, which will
647 be used in the \i{headers} and \i{footers} of the formatted output.
648
649 \lcont{
650
651 A traditional order for the arguments appears to be:
652
653 \n The name of the program.
654
655 \n The (numeric) manual section.
656
657 \n The date that the \cw{man} page was written.
658
659 \n The name of any containing suite of which the program is a part.
660
661 \n The name of the \i{author} of the \cw{man} page.
662
663 For example, a typical \cw{man} page might contain
664
665 \c \cfg{man-identity}{make-foo}{1}{June 2003}{foo-utils}{Fred Bloggs}
666
667 }
668
669 \dt \I{\cw{\\cfg\{man-headnumbers\}}}\cw{\\cfg\{man-headnumbers\}\{}\e{boolean}\cw{\}}
670
671 \dd If this is set to \c{true}, then \i{section headings} in the
672 \cw{man} page will have their \i{section numbers} displayed as usual. If
673 set to \c{false}, the section numbers will be omitted. (\cw{man}
674 pages traditionally have section names such as \q{SYNOPSIS},
675 \q{OPTIONS} and \q{BUGS}, and do not typically number them, so
676 \c{false} is the setting which conforms most closely to normal
677 \cw{man} style.)
678
679 \dt \I{\cw{\\cfg\{man-mindepth\}}}\cw{\\cfg\{man-mindepth\}\{}\e{depth}\cw{\}}
680
681 \dd If this is set to a number greater than 0, then section headings
682 \e{higher} than the given depth will not be displayed. If it is set
683 to zero, all section headings will be displayed as normal.
684
685 \lcont{
686
687 The point of this is so that you can use the same Halibut input file
688 to generate a quick-reference \cw{man} page for a program, \e{and} to
689 include that \cw{man} page as an appendix in your program's full manual.
690 If you are to include the \cw{man} page as an appendix, then the internal
691 headings within the page will probably need to be at \c{\\H} or
692 \c{\\S} level; therefore, when you format that input file on its own
693 to create the \cw{man} page itself, you will need to have defined a
694 \c{\\C} and possibly a \c{\\H} heading beforehand, which you don't
695 want to see displayed.
696
697 Here's an example. You might have a file \c{appendix.but}, which
698 simply says
699
700 \c \A{manpages} \cw{man} pages for the Foo tool suite
701 \c
702 \c \cfg{man-mindepth}{2}
703
704 Then you have a file \c{make-foo.but}, and probably others like it
705 as well, each of which looks something like this:
706
707 \c \cfg{man-identity}{make-foo}{1}{June 2003}{foo-utils}{Fred Bloggs}
708 \c
709 \c \H{man-foo} \cw{man} page for \c{make-foo}
710 \c
711 \c \S{man-foo-name} NAME
712 \c
713 \c \c{make-foo} - create Foo files for the Foo tool suite
714 \c
715 \c \S{man-foo-synopsis} SYNOPSIS
716 \c
717 \c ... and so on ...
718 \e iiiiiiiiiiiiiiiii
719
720 So when you're generating your main manual, you can include
721 \c{appendix.but} followed by \c{make-foo.but} and any other \cw{man}
722 pages you have, and your \cw{man} pages will be formatted neatly as
723 part of an appendix. Then, in a separate run of Halibut, you can
724 just do
725
726 \c halibut appendix.but make-foo.but
727
728 and this will generate a \cw{man} page \c{output.1}, in which the
729 headings \q{\cw{man} pages for the Foo tool suite} and \q{\cw{man}
730 page for \c{make-foo}} will not be displayed because of the
731 \c{man-mindepth} directive. So the first visible heading in the
732 output \cw{man} page will be \q{NAME}, exactly as a user would
733 expect.
734
735 }
736
737 The \i{default settings} for the \cw{man} page output format are:
738
739 \c \cfg{man-filename}{output.1}
740 \c \cfg{man-identity}{}
741 \c \cfg{man-headnumbers}{false}
742 \c \cfg{man-mindepth}{0}