Add support for doing different underlining of different heading levels
[sgt/halibut] / inputs / test.but
1 \define{eur} \u20AC{EUR }
2
3 \title Halibut: A Test Document With A Stupidly Long Title (worth \eur\.1000)
4 Just To See If Wrapping Titles Works OK. In Fact This Title Will Span Three
5 Lines, Not Just Two. How's That For Ludicrous? More than that, though,
6 we'd like to make it more than 255 characters long so that the PostScript
7 backend has to treat it specially in order to pass it to pdfmark.
8
9 \cfg{xhtml-leaf-smallest-contents}{2}
10 \cfg{xhtml-leaf-contains-contents}
11 {true}
12 \cfg{info-dir-entry}{Sillinesses}{test.but}{Halibut test document}
13 \cfg{info-dir-entry}{Florbles}{test.but}{Subsection of Halibut test
14 document}{sub-sub}
15 \cfg{info-section-underline}{2}{~}
16 \cfg{man-headnumbers}{true}
17
18 \cfg{contents}{Contents(edited)}
19 \cfg{index}{Index(alsoedited)}
20
21 This paragraph is not labelled \q{preamble}, but should still appear
22 as it.
23
24 \preamble This manual is a small joke effort, designed to use every
25 feature \#{ comment } that Halibut's input format supports. Creation
26 date \date{%Y.%m.%d} (default format is \date).
27
28 \c Here is a code paragraph in the preamble, just to stress that all
29 \c things are possible. Ooh!
30
31 \copyright Copyright 1999 Simon \#{second comment}Tatham. All rights
32 reserved.
33
34 Here's another \i{preamble paragraph}, which goes after the copyright.
35
36 \define{metacoopt} [this is a nested,
37 multi-line macro, talking about \coopt
38 a bit]
39
40 \define{coopt} co\u00F6{-o}pt
41
42 \versionid $Id$
43
44 \C{ch\\ap} First chapter title; for similar wrapping reasons this
45 chapter title will be ludicrously long. I wonder how much more
46 chapter title I can write before feeling silly.
47
48 This is a para\#{another{} comment}graph of text. It
49 has line\#{yet another one} breaks in between words, multiple
50 spaces (ignored), and \e{emphasised text} as well as \c{code
51 fragments}.
52
53 \#{This is an inline comment alone in a paragraph.}
54
55 \cw{This} is weak code; \cq{this} is quoted code. And \k{head}
56 contains some other stuff. \K{subhead} does too.
57
58 To test the man page back end:
59
60 .Directive
61
62 'Directive
63
64 \cw{.Directive}
65
66 \cw{'Directive}
67
68 \\Sping\\Spong\\Spoing
69
70 \H{head} First section title (very long again, no prizes for
71 guessing the reason why this time, and here's yet more text to pad
72 it out to three lines of output)
73
74 \cfg{winhelp-topic}{M359HPEHGW}
75
76 Here's a code paragraph:
77
78 \c No leading spaces
79 \c One leading space
80 \c Two blank lines follow this one.
81 \c
82 \c
83 \c Two blank lines precede this one.
84 \c Two leading spaces
85 \c We can use \ { and } with impunity here.
86 \c We can use discretionary bold and italic in code paragraphs!
87 \e bbbb iiiiii
88 \c Isn't that ludicrous?
89
90 This is a list:
91
92 \b Ooh.
93
94 \b Aah.
95
96 \lcont{
97
98 This bulletted list contains a list continuation. This is an
99 additional paragraph, or more than one, indented at the same level
100 as the list items, and able to contain nested sublists and other
101 features. For example, here's a code paragraph:
102
103 \c spingle:~$ whoami
104 \c spoggler
105
106 And here's a sublist. Numbered, just for variety.
107
108 \n One.
109
110 \lcont{
111
112 \n 1a.
113
114 \n 1b.
115
116 \lcont{
117 \c Code
118 \c Paragraph
119 }
120
121 \n 1c.
122
123 \lcont{This is an even sillier one: a continuation of a list item in
124 a continuation of a list item in a continuation of a list item!}
125
126 }
127
128 \n Two.
129
130 \n Threeeee!
131
132 }
133
134 \b Eek.
135
136 This is a horizontal rule:
137
138 \rule
139
140 This is a numbered list:
141
142 \n Ooh.
143
144 \n{keyword} Aah.
145
146 \n Eek. \q{Aah} is point \k{keyword}.
147
148 This is a description list:
149
150 \dt FISH
151
152 \dd A piscine creature, often to be found swimming aimlessly around
153 in the sea eating things and not contributing to the global economy.
154
155 \lcont{
156
157 Here's another of those funky list continuation things, just to keep
158 Halibut on its toes.
159
160 }
161
162 \dt BADGER
163
164 \dd A non-piscine creature, often to be found snuffling around on
165 land, not contributing to the global economy, and not even swimming
166 to make up for it. I don't know. These mammals. Pa-thetic.
167
168 \dt "SAUSAGE SALESMAN"
169
170 \dd An exemplary contributor to the global economy. Unless he's CMOT
171 Dibbler.
172
173 This is a much more interesting description list, testing
174 consecutive \c{\\dt}s and consecutive \c{\\dd}s:
175
176 \dt One
177
178 \dt Two
179
180 \dt Three
181
182 \dd Ay
183
184 \dt Four
185
186 \dd Bee
187
188 \dd Cee
189
190 \dd Dee
191
192 A-paragraph-full-of-hyphens-to-test-the-idea-that-word-wrapping-can-happen-somewhere-in-all-this-hyphenatory-nonsense.
193
194 A\-paragraph\-full\-of\-nonbreaking\-hyphens\-to\-test\-the\-idea\-that\-word\-wrapping\-misses\-them.
195
196 A\_paragraph\_full\_of\_nonbreaking\_spaces\_to\_test\_the\_idea\_that\_word\_wrapping\_misses\_them\_too.
197
198 Use of macros: let's talk about \coopt. And about \coopt some more.
199 And a nested macro: \metacoopt.
200
201 A slightly more difficult macro: \eur\.2500.
202
203 Test of input character set switching.
204
205 \n 8859 character in ASCII mode: expect nothing useful. [coöpt]
206
207 \cfg{input-charset}{ISO-8859-1}
208
209 \n 8859 character in 8859 mode: expect the right thing. [coöpt]
210
211 \cfg{input-charset}{UTF-8}
212
213 \n 8859 character in UTF-8 mode: expect the wrong thing. [coöpt]
214
215 \cfg{silliness}{coöpt}
216
217 \n UTF-8 sequence in UTF-8 mode: expect the right thing again. [coöpt]
218
219 \cfg{input-charset}{ASCII}
220
221 Back to ASCII again.
222
223 Oh, while I'm here: some special characters. The \\, \{ and \}
224 characters, to be precise. And their code equivalents, \c{\\},
225 \i\c{\{}, \c{\}}. The ` and ' characters (grave and apostrophe)
226 are special in some output formats.
227
228 Now let's exercise the paper backends a little. This is the entire
229 Adobe Standard Latin character set, which should be enough to cause
230 us to need to encode the main font twice:
231
232 \cfg{input-charset}{ISO-8859-1}
233
234 A Æ Á Â Ä À Å Ã B C Ç D E É Ê Ë È Ð F G H I Í Î Ï Ì J K L \u0141 M N Ñ O Ó Ô Ö
235 \u0152 Ò Ø Õ P Q R S \u0160 T Þ U Ú Û Ü Ù V W X Y Ý \u017d
236 a á â ´ ä æ à & å ^ ~ * @ ã b \\ | \{ \} [ ] ¦ \u2022
237 c \u02c7 ç ¸ ¢ \u02c6 : , © ¤ d \u2020 \u2021 ° ¨ ÷ $ \u02d9 \u0131
238 e é ê ë è 8 \u2026 \u2014 \u2013 = ð ! ¡ f \ufb01 5 \ufb02 \u0192 4 \u2044
239 g ß \u2039 \u203a ` > « » h - \u02dd i í î ï ì j k l \u0142 < ¬
240 m \u2212 \u00B5 × n 9 ñ # o ó ô ö \u0153 ò 1 ½ ¼ ¹ ª º ø õ
241 p \u00b6 ( ) % \u2030 . · + ±
242 q ? ¿ " \u201e \u201c \u201d \u2018 \u2019 \u201a '
243 r ® \u02da s \u0161 \u00A7 ; 7 6 / £ t þ 3 ¾ ³ \u02dc \u2122 2 ²
244 u ú û ü ù _ v w x y ý ÿ ¥ z \u017e 0
245
246 \cfg{input-charset}{ASCII}
247
248 Testing ligatures in normal (fi), empasised (\e{fi}), code (\c{fi}) and
249 weak code (\cw{fi}). The latter two should not be ligated.
250
251 \c Also in a code paragraph (fi) with bold (fi) and italic (fi).
252 \e bb ii
253 \c There should be no ligation there.
254
255 The following pair of characters map to different glyphs with the same name in
256 some Microsoft TrueType fonts: \u0394{(missing)} \u2206{(missing)}
257
258 \S{subhead} First subheading
259
260 So here's a \I{subheading}\I{subsection}subsection. Just
261 incidentally, \q{this} is in quotes. \ii{Those} quotes had better work
262 in all formats.
263
264 We'll try for some Unicode here: \i{Schr\u00F6{oe}dinger}.
265
266 An index tag containing non-alternatived Unicode: \i{\u00BFChe?}
267
268 An invisible index tag: \I{she seems to have an invisible tag}yeah.
269
270 An index tag inside another tag: jackdaws love my \e{big \i{sphinx}}
271 of quartz.
272
273 Similarly, we should support things like hyperlinks
274 \e{\W{http://www.tartarus.org/}{at the beginning} of emphasised sections},
275 and \e{in the \W{http://www.tartarus.org/}{middle} of them}, and also
276 \e{at the \W{http://home.att.net/~cecw/lastpage.htm}{end}}.
277
278 \#{FIXME: Unfortunately, we still don't quite do the right thing with
279 references:
280 How about a \e{reference to \k{subhead} here}? And at
281 \e{the end: \k{subhead}} and \e{\k{subhead}: the start}?
282 }
283
284 \S2{sub-sub}{Florble} Smaller heading still
285
286 A tiny section. Awww. How cute. Actually, this one's a \e{florble},
287 and here's a reference to it: \k{sub-sub}.
288
289 \A{app} Needless appendix
290
291 \# \cfg{winhelp-topic}{Y5VQEXZQVJ} (uncomment this and it clashes)
292
293 Here's an \i{appendix}, for no terribly good reason at all. See
294 __\k{book}__ (please excuse those underscores, I'm testing
295 whitespace).
296
297 It also contains a \W{http://www.tartarus.org/}{hyperlink}.
298
299 Also I'm going to index \i\c{-output} to ensure that its two
300 components are displayed as a joined-up code fragment in the index.
301
302 Here are \I{testone}some \I{testtwo}subsections \I{testthree}with
303 silly chapter titles and interesting use of Unicode. The Unicode
304 oddities are in the titles rather than the body text because that
305 way I get to test their handling in the PDF document outline.
306
307 \H{app-one} The 1024 \u00D7{x} 768 screen resolution
308
309 Err.
310
311 \H{app-two} How about Spongletech\u2122{(TM)}?
312
313 Umm.
314
315 \# I'm going to label one of these with a carefully chosen fragment
316 \# name "i1", because I know this will also be generated as an index
317 \# fragment name and this allows me to test the fragment name clash
318 \# detection.
319 \#
320 \# To actually run this test you need to configure html-leaf-level
321 \# to 0 and html-template-fragment to %k.
322
323 \H{i1} Or just Erd\u0151{\u00F6{o}}s?
324
325 Ahh.
326
327 \H{app-\\two} Section with inconvenient keyword
328
329 If you apply this file together with \cw{doc/chm.but}, this section
330 should test \cw{html_sanitise_filename()}.
331
332 \U Bibliography
333
334 \B{book} Some text describing a book.
335
336 \B{nocite} Some text describing a book. This text should appear in
337 the document even though there is no \cw{\\k} citing it.
338
339 \BR{book} [SillyCitation]
340 \BR{uncited} Badger.
341
342 \nocite{nocite}
343
344 \B{uncited} If this text appears, there's an actual error.
345
346 \# This is a comment.
347
348 \# Now for the index section.
349
350 \IM{she seems to have an invisible tag}{appendix} Invisible tags
351 and/or appendices
352
353 \# The display forms of these three index terms differ only in case.
354 \# This is a fiddly special case in the Windows Help backend,
355 \# because Windows Help's index mechanism is case-insensitive...
356
357 \IM{testone} Test
358 \IM{testtwo} TesT
359 \IM{testthree} test