Added an info(1) backend, which constructs .info files directly
[sgt/halibut] / doc / output.but
CommitLineData
16ea3abe 1\C{output} Halibut output formats
2
339cbe09 3This chapter describes each of Halibut's current \i{output formats}.
4It gives some general information about the format, and also
5describes all the \i{configuration directives} which are specific to
6that format.
16ea3abe 7
8\H{output-text} Plain text
9
339cbe09 10This output format generates the document as a single \i{plain text}
0a6347b4 11file.
16ea3abe 12
339cbe09 13The output file is currently assumed to be in the \i{ISO 8859-1}
16ea3abe 14character set. Any Unicode characters representable in this set will
15be output verbatim; any other characters will not be output and
339cbe09 16their \i{fallback text} (if any) will be used instead.
16ea3abe 17
18The precise formatting of the text file can be controlled by a
19variety of configuration directives. They are listed in the
20following subsections.
21
0a6347b4 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.
27This directive is implicitly generated if you provide a file name
28parameter after the command-line option \i\c{--text} (see
29\k{running-options}).
30
16ea3abe 31\S{output-text-dimensions} Indentation and line width
32
33This section describes the configuration directives which control
339cbe09 34the \i{horizontal dimensions} of the output text file: how much
16ea3abe 35paragraphs are indented by and how long the lines are.
36
339cbe09 37\dt \I{\cw{\\cfg\{text-width\}}}\cw{\\cfg\{text-width\}\{}\e{width}\cw{\}}
16ea3abe 38
339cbe09 39\dd Sets the \I{text width}width of the main part of the document,
40in characters. This width will be used for wrapping paragraphs and
41for centring titles (if you have asked for titles to be centred -
42see \k{output-text-headings}). This width does \e{not} include the
43left indentation set by \cw{\\cfg\{text-indent\}}; if you specify an
16ea3abe 44indent of 8 and a width of 64, your maximum output line length will
45be 72.
46
339cbe09 47\dt \I{\cw{\\cfg\{text-indent\}}}\cw{\\cfg\{text-indent\}\{}\e{indent}\cw{\}}
16ea3abe 48
339cbe09 49\dd Sets the left \i{indentation} for the document. If you set this
50to zero, your document will look like an ordinary text file as
51someone with a text editor might have written it; if you set it
52above zero, the text file will have a \i{margin} down the left in
53the style of some printed manuals, and you can then configure the
54section numbers to appear in this margin (see
55\k{output-text-headings}).
16ea3abe 56
339cbe09 57\dt \I{\cw{\\cfg\{text-indent-code\}}}\cw{\\cfg\{text-indent-code\}\{}\e{indent}\cw{\}}
16ea3abe 58
59\dd Specifies how many extra characters of indentation (on top of
339cbe09 60the normal left indent) should be given to \I{code paragraphs,
61indentation} code paragraphs.
16ea3abe 62
339cbe09 63\dt \I{\cw{\\cfg\{text-list-indent\}}}\cw{\\cfg\{text-list-indent\}\{}\e{indent}\cw{\}}
16ea3abe 64
65\dd Specifies how many extra spaces should be used to indent the
339cbe09 66bullet or number in a \I{bulletted list, indentation}bulletted or
67\I{numbered list, indentation}numbered \I{list, indentation}list.
68The actual body of the list item will be indented by this much
69\e{plus} the value configured by \cw{\\cfg\{text-listitem-indent\}}.
16ea3abe 70
339cbe09 71\dt \I{\cw{\\cfg\{text-listitem-indent\}}}\cw{\\cfg\{text-listitem-indent\}\{}\e{indent}\cw{\}}
16ea3abe 72
73\dd Specifies how many extra spaces should be used to indent the
74body of a list item, over and above the number configured in
75\cw{\\cfg\{text-list-indent\}}.
76
339cbe09 77\dt \I{\cw{\\cfg\{text-indent-preamble\}}}\cw{\\cfg\{text-indent-preamble\}\{}\e{boolean}\cw{\}}
16ea3abe 78
339cbe09 79\dd When this is set to \c{true}, the document \i{preamble} (i.e. any
16ea3abe 80paragraphs appearing before the first chapter heading) will be
81indented to the level specified by \cw{\\cfg\{text-indent\}}. If
82this setting is \c{false}, the document preamble will not be
83indented at all from the left margin.
84
339cbe09 85\S{output-text-headings} \ii{Configuring heading display}
16ea3abe 86
87The directives in this section allow you to configure the appearance
88of the title, chapter and section headings in your text file.
89
339cbe09 90Several of the directives listed below specify the \i{alignment} of
91a heading. These alignment options have three possible values:
16ea3abe 92
339cbe09 93\dt \i\c{left}
16ea3abe 94
95\dd Align the heading to the very left of the text file (column zero).
96
339cbe09 97\dt \i\c{leftplus}
16ea3abe 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
102left of that (so that it goes in the margin if there is room).
103
339cbe09 104\dt \i\c{centre}
16ea3abe 105
106\dd Centre the heading.
107
108Also, several of the directives below specify how a title should be
339cbe09 109\I{underlining}underlined. The parameter to one of these directives
110should be either blank (\cw{\{\}}) or a single character. In the
111latter case, that character will be used to underline the title. So
112you might want to specify, for example,
113\cw{\\text-title-underline\{=\}} but
16ea3abe 114\cw{\\text-chapter-underline\{-\}}.
115
339cbe09 116\dt \I{\cw{\\cfg\{text-title-align\}}}\cw{\\cfg\{text-title-align\}\{}\e{alignment}\cw{\}}
16ea3abe 117
118\dd Specifies the alignment of the overall document title: \c{left},
119\c{leftplus} or \c{centre}.
120
339cbe09 121\dt \I{\cw{\\cfg\{text-title-underline\}}}\cw{\\cfg\{text-title-underline\}\{}\e{underline-character}\cw{\}}
16ea3abe 122
123\dd Specifies how the overall document title should be underlined.
124
339cbe09 125\dt \I{\cw{\\cfg\{text-chapter-align\}}}\cw{\\cfg\{text-chapter-align\}\{}\e{alignment}\cw{\}}
16ea3abe 126
127\dd Specifies the alignment of chapter and appendix headings.
128
339cbe09 129\dt \I{\cw{\\cfg\{text-chapter-underline\}}}\cw{\\cfg\{text-chapter-underline\}\{}\e{underline-character}\cw{\}}
16ea3abe 130
131\dd Specifies how chapter and appendix headings should be underlined.
132
339cbe09 133\dt \I{\cw{\\cfg\{text-chapter-numeric\}}}\cw{\\cfg\{text-chapter-numeric\}\{}\e{boolean}\cw{\}}
16ea3abe 134
135\dd If this is set to \c{true}, then chapter headings will not
136contain the word \q{Chapter} (or whatever other word you have
137defined in its place - see \k{input-sections} and \k{input-config});
138they will just contain the chapter \e{number}, followed by the
139chapter title. If you set this to \c{false}, chapter headings will
140be prefixed by \q{Chapter} or equivalent.
141
339cbe09 142\dt \I{\cw{\\cfg\{text-chapter-suffix\}}}\cw{\\cfg\{text-chapter-suffix\}\{}\e{text}\cw{\}}
16ea3abe 143
144\dd This specifies the suffix text to be appended to the chapter
145number, before displaying the chapter title. For example, if you set
146this to \q{\cw{:\_}}, then the chapter title might look something
147like \q{Chapter 2: Doing Things}.
148
339cbe09 149\dt \I{\cw{\\cfg\{text-section-align\}}}\cw{\\cfg\{text-section-align\}\{}\e{level}\cw{\}\{}\e{alignment}\cw{\}}
16ea3abe 150
151\dd Specifies the alignment of section headings at a particular
152level. The \e{level} parameter specifies which level of section
153headings you want to affect: 0 means first-level headings (\c{\\H}),
1541 means second-level headings (\c{\\S}), 2 means the level below
155that (\c{\\S2}), and so on. The \e{alignment} parameter is treated
156just like the other alignment directives listed above.
157
339cbe09 158\dt \I{\cw{\\cfg\{text-section-underline\}}}\cw{\\cfg\{text-section-underline\}\{}\e{level}\cw{\}\{}\e{underline-character}\cw{\}}
16ea3abe 159
160\dd Specifies how to underline section headings at a particular level.
161
339cbe09 162\dt \I{\cw{\\cfg\{text-section-numeric\}}}\cw{\\cfg\{text-section-numeric\}\{}\e{level}\cw{\}\{}\e{boolean}\cw{\}}
16ea3abe 163
164\dd Specifies whether section headings at a particular level should
165contain the word \q{Section} or equivalent (if \c{false}), or should
166be numeric only (if \c{true}).
167
339cbe09 168\dt \I{\cw{\\cfg\{text-section-suffix\}}}\cw{\\cfg\{text-section-suffix\}\{}\e{level}\cw{\}\{}\e{text}\cw{\}}
16ea3abe 169
339cbe09 170\dd Specifies the \I{suffix text, in section titles}suffix text to
171be appended to section numbers at a particular level, before
172displaying the section title.
16ea3abe 173
174\S{output-text-misc} Miscellaneous configuration options
175
339cbe09 176\dt \I{\cw{\\cfg\{text-versionid\}}}\cw{\\cfg\{text-versionid\}\{}\e{boolean}\cw{\}}
16ea3abe 177
339cbe09 178\dd If this is set to \c{true}, \i{version ID paragraphs} (defined
179using the \i\c{\\versionid} command - see \k{input-blurb}) will be
180included at the bottom of the text file. If it is set to \c{false},
181they will be omitted completely.
16ea3abe 182
339cbe09 183\dt \I{\cw{\\cfg\{text-bullet\}}}\cw{\\cfg\{text-bullet\}\{}\e{text}\cw{\}}
16ea3abe 184
339cbe09 185\dd This specifies the text which should be used as the \i{bullet}
186in bulletted lists. It can be one character
16ea3abe 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
339cbe09 197The \i{default settings} for Halibut's plain text output format are:
16ea3abe 198
0a6347b4 199\c \cfg{text-filename}{output.txt}
200\c
16ea3abe 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
339cbe09 231This output format generates an \i{HTML} version of the document. By
16ea3abe 232default, this will be in multiple files, starting with
233\c{Contents.html} and splitting the document into files by chapter
234and/or subsection. You can configure precisely how the text is split
235between HTML files using the configuration commands described in
236this section. In particular, you can configure Halibut to output one
0a6347b4 237single HTML file instead of multiple ones.
16ea3abe 238
339cbe09 239Strictly speaking, the output format is \i{XHTML} 1.0 Transitional,
16ea3abe 240which is why all of the configuration directives start with the word
241\c{xhtml} rather than \c{html}.
242
0a6347b4 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
248contents page. Since this is the first page a user ought to see when
249beginning to read the document, a good choice in many cases might be
250\c{index.html} (but this is not the default, for historical
251reasons).
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
260names of each chapter or section of the document. This template
261should contain at least one \i\e{formatting command}, in the form of
262a per cent sign followed by a letter. (If you need a literal per
263cent sign, you can write \c{%%}.)
264
265\lcont{
266
267The 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
272removed. So in a chapter declared as \q{\cw{\\C\{fish\} Catching
273Fish}}, 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
279space. So in chapter 1 this would expand to \q{\cw{Chapter1}}; in
280section A.4.3 it would expand to \q{\cw{SectionA.4.3}}, and so on.
281If 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
288would 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
290unnumbered chapter created using \c{\\U}), this directive falls back
291to 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.
296So in a chapter declared as \q{\cw{\\C\{fish\} Catching Fish}}, this
297formatting command would expand to \q{\cw{fish}}. If the section has
298no keyword (an unnumbered chapter created using \c{\\U}), this
299directive falls back to doing the same thing as \c{%N}.
300
301These 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
310Halibut is configured (using \c{\\cfg\{xhtml-leaf-level\}\{0\}} to
311produce a single self-contained file. Both this directive \e{and}
312\c{\\cfg\{xhtml-leaf-level\}\{0\}} are implicitly generated if you
313provide a file name parameter after the command-line option
314\i\c{--html} (see \k{running-options}).
315
16ea3abe 316\S{output-html-split} Controlling the splitting into HTML files
317
318By default, the HTML output from Halibut is split into multiple
319files. Each file typically contains a single chapter or section and
320everything below it, unless subsections of that chapter are
321themselves split off into further files.
322
323Most files also contain a contents section, giving hyperlinks to the
324sections in the file and/or the sections below it.
325
326The configuration directives listed below allow you to configure the
327splitting into files, and the details of the contents sections.
328
339cbe09 329\dt \I{\cw{\\cfg\{xhtml-leaf-level\}}}\cw{\\cfg\{xhtml-leaf-level\}\{}\e{depth}\cw{\}}
16ea3abe 330
331\dd This setting indicates the depth of section which should be
339cbe09 332given a \I{leaf file}\q{leaf} file (a file with no sub-files). So if
333you set it to 1, for example, then every chapter will be given its
334own HTML file, plus a top-level \i{contents file}. If you set this
335to 2, then each chapter \e{and} each \c{\\H} section will have a
336file, and the chapter files will mostly just contain links to their
337\i{sub-file}s.
16ea3abe 338
339\lcont{
340
341If you set this option to zero, then the whole document will appear
342in a single file. If you do this, Halibut will call that file
339cbe09 343\i\c{Manual.html} instead of \i\c{Contents.html}.
16ea3abe 344
0a6347b4 345This option is automatically set to zero if you provide a file name
346parameter after the command-line option \i\c{--html} (see
347\k{running-options}), because you have specified a single file name
348and so Halibut assumes you want the whole document to be placed in
349that file.
350
16ea3abe 351}
352
339cbe09 353\dt \I{\cw{\\cfg\{xhtml-contents-depth\}}}\cw{\\cfg\{xhtml-contents-depth-}\e{level}\cw{\}\{}\e{depth}\cw{\}}
16ea3abe 354
339cbe09 355\dd This directive allows you to specify how \I{depth of
356contents}deep the contents section in a particular file should go.
16ea3abe 357
358\lcont{
359
360The \e{level} parameter indicates which level of contents section
361you are dealing with. 0 denotes the main contents section in the
362topmost file \c{Contents.html}; 1 denotes a contents section in a
363chapter file; 2 is a contents section in a file containing a \c{\\H}
364heading, and so on. Currently you can't go below level 5 (which
365corresponds to a \c{\\S3} heading).
366
367The \e{depth} parameter indicates the maximum depth of heading which
368will be shown in this contents section. Again, 1 denotes a chapter,
3692 is a \c{\\H} heading, 3 is a \c{\\S} heading, and so on.
370
371So, for example: \cw{\\cfg\{xhtml-contents-depth-1\}\{3\}} instructs
372Halibut to put contents links in chapter files for all sections down
373to \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
339cbe09 381\dt \I{\cw{\\cfg\{xhtml-leaf-contains-contents\}}}\cw{\\cfg\{xhtml-leaf-contains-contents\}\{}\e{boolean}\cw{\}}
16ea3abe 382
383\dd If you set this to \c{true}, then each leaf file will contain
384its own contents section which summarises the text within it.
385
339cbe09 386\dt \I{\cw{\\cfg\{xhtml-leaf-smallest-contents\}}}\cw{\\cfg\{xhtml-leaf-smallest-contents\}\{}\e{number}\cw{\}}
16ea3abe 387
388\dd Contents sections in leaf files are not output at all if they
389contain very few entries (on the assumption that it just isn't worth
390bothering). This directive configures the minimum number of entries
391required in a leaf contents section to make Halibut bother
392generating it at all.
393
394\S{output-html-html} Including pieces of your own HTML
395
396The directives in this section allow you to supply pieces of
339cbe09 397\I{HTML}\i{verbatim HTML} code, which will be included in various
398parts of the output files.
16ea3abe 399
339cbe09 400\dt \I{\cw{\\cfg\{xhtml-head-end\}}}\cw{\\cfg\{xhtml-head-end\}\{}\e{HTML text}\cw{\}}
16ea3abe 401
402\dd The text you provide in this directive is placed at the end of
339cbe09 403the \i\cw{<HEAD>} section of each output HTML file. So this is a
404good place to put, for example, a link to a \i{CSS} \i{stylesheet}.
16ea3abe 405
339cbe09 406\dt \I{\cw{\\cfg\{xhtml-body-tag\}}}\cw{\\cfg\{xhtml-body-tag\}\{}\e{HTML text}\cw{\}}
16ea3abe 407
408\dd The text you provide in this directive is used in place of the
339cbe09 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
16ea3abe 411\cw{\\cfg\{xhtml-body-tag\}\{<body bg="#123456">\}}.
412
339cbe09 413\dt \I{\cw{\\cfg\{xhtml-body-start\}}}\cw{\\cfg\{xhtml-body-start\}\{}\e{HTML text}\cw{\}}
16ea3abe 414
415\dd The text you provide in this directive is placed at the
339cbe09 416beginning of the \i\cw{<BODY>} section of each output HTML file. So
417if you intend your HTML files to be part of a web site with a
418standard \i{house style}, and the style needs a \i{header} at the
419top of every page, this is where you can add that header.
16ea3abe 420
339cbe09 421\dt \I{\cw{\\cfg\{xhtml-body-end\}}}\cw{\\cfg\{xhtml-body-end\}\{}\e{HTML text}\cw{\}}
16ea3abe 422
339cbe09 423\dd The text you provide in this directive is placed at the end of
424the \i\cw{<BODY>} section of each output HTML file. So if you intend
425your HTML files to be part of a web site with a standard \i{house
426style}, and the style needs a \i{footer} at the bottom of every
427page, this is where you can add that footer.
16ea3abe 428
339cbe09 429\dt \I{\cw{\\cfg\{xhtml-address-start\}}}\cw{\\cfg\{xhtml-address-start\}\{}\e{HTML text}\cw{\}}
16ea3abe 430
431\dd The text you provide in this directive is placed at the
339cbe09 432beginning of the \i\cw{<ADDRESS>} section at the bottom of each
433output HTML file. This might be a good place to put authors'
434\i{contact details}, for example.
16ea3abe 435
339cbe09 436\dt \I{\cw{\\cfg\{xhtml-address-end\}}}\cw{\\cfg\{xhtml-address-end\}\{}\e{HTML text}\cw{\}}
16ea3abe 437
339cbe09 438\dd The text you provide in this directive is placed at the end of
439the \i\cw{<ADDRESS>} section at the bottom of each output HTML file,
440after the version IDs (if present).
16ea3abe 441
339cbe09 442\dt \I{\cw{\\cfg\{xhtml-navigation-attributes\}}}\cw{\\cfg\{xhtml-navigation-attributes\}\{}\e{HTML attributes}\cw{\}}
16ea3abe 443
444\dd The text you provide in this directive is included inside the
339cbe09 445\cw{<P>} tag containing the \i{navigation links} at the top of each
446page (\i{\q{Previous}} / \i{\q{Contents}} / \i{\q{Next}}). So if you
447wanted the navigation links to have a particular CSS style, you
448could write
16ea3abe 449\cw{\\cfg\{xhtml-navigation-attributes\}\{class="foo"\}}, and the
450navigation-links paragraph would then begin with the tag \cw{<p
451class="foo">}.
452
339cbe09 453\S{output-html-headings} \ii{Configuring heading display}
16ea3abe 454
339cbe09 455\dt \I{\cw{\\cfg\{xhtml-chapter-numeric\}}}\cw{\\cfg\{xhtml-chapter-numeric\}\{}\e{boolean}\cw{\}}
16ea3abe 456
457\dd If this is set to \c{true}, then chapter headings will not
458contain the word \q{Chapter} (or whatever other word you have
459defined in its place - see \k{input-sections} and \k{input-config});
460they will just contain the chapter \e{number}, followed by the
461chapter title. If you set this to \c{false}, chapter headings will
462be prefixed by \q{Chapter} or equivalent.
463
339cbe09 464\dt \I{\cw{\\cfg\{xhtml-chapter-suffix\}}}\cw{\\cfg\{xhtml-chapter-suffix\}\{}\e{text}\cw{\}}
16ea3abe 465
466\dd This specifies the suffix text to be appended to the chapter
467number, before displaying the chapter title. For example, if you set
468this to \q{\cw{:\_}}, then the chapter title might look something
469like \q{Chapter 2: Doing Things}.
470
339cbe09 471\dt \I{\cw{\\cfg\{xhtml-section-numeric\}}}\cw{\\cfg\{xhtml-section-numeric\}\{}\e{boolean}\cw{\}}
16ea3abe 472
473\dd Specifies whether section headings at a particular level should
474contain the word \q{Section} or equivalent (if \c{false}), or should
475be numeric only (if \c{true}). The \e{level} parameter specifies
476which level of section headings you want to affect: 0 means
477first-level headings (\c{\\H}), 1 means second-level headings
478(\c{\\S}), 2 means the level below that (\c{\\S2}), and so on.
479
339cbe09 480\dt \I{\cw{\\cfg\{xhtml-section-suffix\}}}\cw{\\cfg\{xhtml-section-suffix\}\{}\e{text}\cw{\}}
16ea3abe 481
482\dd Specifies the suffix text to be appended to section numbers at a
483particular level, before displaying the section title.
484
485\S{output-html-misc} Miscellaneous options
486
0a6347b4 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
490same syntax used in \cw{\\cfg\{xhtml-template-filename\}} (see
491\k{output-html-file}), to be used for the anchor names (\i\cw{A
492NAME="..."}) used to allow URLs to refer to specific sections within
493a particular HTML file. So if you set this to \q{\cw{%k}}, for
494example, then each individual section in your document will be
495addressable by means of a URL ending in a \c{#} followed by your
496internal section keyword.
497
339cbe09 498\dt \I{\cw{\\cfg\{xhtml-versionid\}}}\cw{\\cfg\{xhtml-versionid\}\{}\e{boolean}\cw{\}}
16ea3abe 499
339cbe09 500\dd If this is set to \c{true}, \i{version ID paragraphs} (defined using
501the \i\c{\\versionid} command - see \k{input-blurb}) will be included
502visibly in the \i\cw{<ADDRESS>} section at the bottom of each HTML
16ea3abe 503file. 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
339cbe09 508\dt \I{\cw{\\cfg\{xhtml-suppress-address\}}}\cw{\\cfg\{xhtml-suppress-address\}\{}\e{boolean}\cw{\}}
16ea3abe 509
339cbe09 510\dd If this is set to \c{true}, the \i\cw{<ADDRESS>} section at the
16ea3abe 511bottom of each HTML file will be omitted completely. (This will
339cbe09 512therefore also cause \i{version IDs} not to be included.)
16ea3abe 513
339cbe09 514\dt \I{\cw{\\cfg\{xhtml-author\}}}\cw{\\cfg\{xhtml-author\}\{}\e{text}\cw{\}}
16ea3abe 515
339cbe09 516\dd The text supplied here goes in a \I{\cw{<META>} tags}\cw{<META
517name="author">} tag in the output HTML files, so that browsers which
518support this can automatically identify the \i{author} of the document.
16ea3abe 519
339cbe09 520\dt \I{\cw{\\cfg\{xhtml-description\}}}\cw{\\cfg\{xhtml-description\}\{}\e{text}\cw{\}}
16ea3abe 521
339cbe09 522\dd The text supplied here goes in a \I{\cw{<META>} tags}\cw{<META
523name="description">} tag in the output HTML files, so that browsers
524which support this can easily pick out a brief \I{description, of
525document}description of the document.
16ea3abe 526
527\S{output-html-defaults} Default settings
528
339cbe09 529The \i{default settings} for Halibut's HTML output format are:
16ea3abe 530
0a6347b4 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
16ea3abe 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
339cbe09 574This output format generates data that can be used by the \i{Windows
0a6347b4 575Help} program \cw{WINHELP.EXE}. There are two actual files
576generated, one ending in \c{.hlp} and the other ending in \c{.cnt}.
577
578The Windows Help output format supports the following configuration
579directives:
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.
584This directive is implicitly generated if you provide a file name
585parameter after the command-line option \i\c{--winhelp} (see
586\k{running-options}).
587
588\lcont{
589
590Your output file name should end with \c{.hlp}; if it doesn't,
591Halibut will append it. Halibut will also generate a contents file
592(ending in \c{.cnt}) alongside the file name you specify.
593
594}
16ea3abe 595
339cbe09 596\dt \I{\cw{\\cfg\{winhelp-topic\}}}\cw{\\cfg\{winhelp-topic\}\{}\e{topic-name}\cw{\}}
16ea3abe 597
339cbe09 598\dd This directive defines a Windows \i{Help topic} name in the current
16ea3abe 599section. Topic names can be used by the program invoking
600\cw{WINHELP.EXE} to jump straight to a particular section. So you
339cbe09 601can use this for \i{context-sensitive help}.
16ea3abe 602
603\lcont{
604
605For example, if you used this directive in a particular section:
606
607\c \cfg{winhelp-topic}{savingfiles}
608
609then a Windows application could invoke Windows Help to jump to that
610particular section in the help file like this:
611
612\c WinHelp(hwnd, "mydoc.hlp", HELP_COMMAND,
613\c (DWORD)"JI(`',`savingfiles')");
614
615You can use this configuration directive many times, in many
616different subsections of your document, in order to define a lot of
617different help contexts which you can use in this way.
618
619}
620
0a6347b4 621The \i{default settings} for the Windows Help output format are:
622
623\c \cfg{winhelp-filename}{output.hlp}
624
625and no \c{\\cfg\{winhelp-topic\}} directives anywhere.
626
16ea3abe 627\H{output-man} Unix \cw{man} pages
628
339cbe09 629This output format generates a Unix \i{\cw{man} page}. That is to say,
630it generates \i\c{nroff} input designed to work with the \c{-mandoc}
16ea3abe 631macro package.
632
633The available configuration options for this format are as follows:
634
0a6347b4 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.
638This directive is implicitly generated if you provide a file name
639parameter after the command-line option \i\c{--man} (see
640\k{running-options}).
641
339cbe09 642\dt \I{\cw{\\cfg\{man-identity\}}}\cw{\\cfg\{man-identity\}\{}\e{text}\cw{\}\{}\e{text...}\cw{\}}
16ea3abe 643
339cbe09 644\dd This directive is used to generate the initial \i{\c{.TH}
645directive} that appears at the top of a \cw{man} page. It expects to
646be followed by some number of brace pairs containing text, which will
647be used in the \i{headers} and \i{footers} of the formatted output.
16ea3abe 648
649\lcont{
650
651A 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
339cbe09 661\n The name of the \i{author} of the \cw{man} page.
16ea3abe 662
663For 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
339cbe09 669\dt \I{\cw{\\cfg\{man-headnumbers\}}}\cw{\\cfg\{man-headnumbers\}\{}\e{boolean}\cw{\}}
16ea3abe 670
339cbe09 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
16ea3abe 673set to \c{false}, the section numbers will be omitted. (\cw{man}
674pages 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
339cbe09 679\dt \I{\cw{\\cfg\{man-mindepth\}}}\cw{\\cfg\{man-mindepth\}\{}\e{depth}\cw{\}}
16ea3abe 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
683to zero, all section headings will be displayed as normal.
684
685\lcont{
686
687The point of this is so that you can use the same Halibut input file
688to generate a quick-reference \cw{man} page for a program, \e{and} to
689include that \cw{man} page as an appendix in your program's full manual.
690If you are to include the \cw{man} page as an appendix, then the internal
691headings 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
693to 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
695want to see displayed.
696
697Here's an example. You might have a file \c{appendix.but}, which
698simply says
699
700\c \A{manpages} \cw{man} pages for the Foo tool suite
701\c
702\c \cfg{man-mindepth}{2}
703
704Then you have a file \c{make-foo.but}, and probably others like it
705as 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
720So 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}
722pages you have, and your \cw{man} pages will be formatted neatly as
723part of an appendix. Then, in a separate run of Halibut, you can
724just do
725
726\c halibut appendix.but make-foo.but
727
728and this will generate a \cw{man} page \c{output.1}, in which the
729headings \q{\cw{man} pages for the Foo tool suite} and \q{\cw{man}
730page for \c{make-foo}} will not be displayed because of the
731\c{man-mindepth} directive. So the first visible heading in the
732output \cw{man} page will be \q{NAME}, exactly as a user would
733expect.
734
735}
736
339cbe09 737The \i{default settings} for the \cw{man} page output format are:
16ea3abe 738
0a6347b4 739\c \cfg{man-filename}{output.1}
16ea3abe 740\c \cfg{man-identity}{}
741\c \cfg{man-headnumbers}{false}
742\c \cfg{man-mindepth}{0}