File: test.but

package info (click to toggle)
halibut 1.3-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,060 kB
  • sloc: ansic: 59,012; perl: 197; lisp: 76; makefile: 50; sh: 1
file content (373 lines) | stat: -rw-r--r-- 10,318 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
\define{eur} \u20AC{EUR }

\title Halibut: A Test Document With A Stupidly Long Title (worth \eur\.1000)
Just To See If Wrapping Titles Works OK. In Fact This Title Will Span Three
Lines, Not Just Two. How's That For Ludicrous?  More than that, though,
we'd like to make it more than 255 characters long so that the PostScript
backend has to treat it specially in order to pass it to pdfmark.

\cfg{xhtml-leaf-smallest-contents}{2}
\cfg{xhtml-leaf-contains-contents}
{true}
\cfg{info-dir-entry}{Sillinesses}{test.but}{Halibut test document}
\cfg{info-dir-entry}{Florbles}{test.but}{Subsection of Halibut test
document}{sub-sub}
\cfg{info-section-underline}{2}{~}
\cfg{info-charset}{utf-8}
\cfg{man-headnumbers}{true}

\cfg{contents}{Contents - edited title}
\cfg{index}{Index - also edited title}

This paragraph is not labelled \q{preamble}, but should still appear
as it.

\preamble This manual is a small joke effort, designed to use every
feature \#{ comment } that Halibut's input format supports. Creation
date \date{%Y.%m.%d} (default format is \date).

\c Here is a code paragraph in the preamble, just to stress that all
\c things are possible. Ooh!

\copyright Copyright 1999 Simon \#{second comment}Tatham. All rights
reserved.

Here's another \i{preamble paragraph}, which goes after the copyright.

\define{metacoopt} [this is a nested,
multi-line macro, talking about \coopt
a bit]

\define{coopt} co\u00F6{-o}pt

\versionid Arbitrary version id text

\C{ch\\ap} First chapter title; for similar wrapping reasons this
chapter title will be ludicrously long. I wonder how much more
chapter title I can write before feeling silly.

This is a para\#{another{} comment}graph of text. It
has line\#{yet another one} breaks in   between words, multiple
  spaces (ignored), \e{emphasised text} and \s{strong text} as well as \c{code
fragments}.

\#{This is an inline comment alone in a paragraph.}

\cw{This} is weak code; \cq{this} is quoted code. And \k{head}
contains some other stuff. \K{subhead} does too.

To test the man page back end:

.Directive

'Directive

\cw{.Directive}

\cw{'Directive}

\\Sping\\Spong\\Spoing

\H{head} First section title (very long again, no prizes for
guessing the reason why this time, and here's yet more text to pad
it out to three lines of output)

\cfg{winhelp-topic}{M359HPEHGW}

Here's a code paragraph:

\c No leading spaces
\c  One leading space
\c Two blank lines follow this one.
\c
\c
\c Two blank lines precede this one.
\c   Two leading spaces
\c We can use \ { and } with impunity here.
\c We can use discretionary bold and italic in code paragraphs!
\e                          bbbb     iiiiii
\c Isn't that ludicrous?
\c 
\c man page tricky characters: command -o 'quoted' -o `backticks`

This is a list:

\b Ooh.

\b Aah.

\lcont{

This bulletted list contains a list continuation. This is an
additional paragraph, or more than one, indented at the same level
as the list items, and able to contain nested sublists and other
features. For example, here's a code paragraph:

\c spingle:~$ whoami
\c spoggler

And here's a sublist. Numbered, just for variety.

\n One.

\lcont{

\n 1a.

\n 1b.

\lcont{
\c Code
\c Paragraph
}

\n 1c.

\lcont{This is an even sillier one: a continuation of a list item in
a continuation of a list item in a continuation of a list item!}

}

\n Two.

\n Threeeee!

}

\b Eek.

This is a horizontal rule:

\rule

This is a numbered list:

\n Ooh.

\n{keyword} Aah.

\n Eek. \q{Aah} is point \k{keyword}.

This is a description list:

\dt FISH

\dd A piscine creature, often to be found swimming aimlessly around
in the sea eating things and not contributing to the global economy.

\lcont{

Here's another of those funky list continuation things, just to keep
Halibut on its toes.

}

\dt BADGER

\dd A non-piscine creature, often to be found snuffling around on
land, not contributing to the global economy, and not even swimming
to make up for it. I don't know. These mammals. Pa-thetic.

\dt "SAUSAGE SALESMAN"

\dd An exemplary contributor to the global economy. Unless he's CMOT
Dibbler.

This is a much more interesting description list, testing
consecutive \c{\\dt}s and consecutive \c{\\dd}s:

\dt One

\dt Two

\dt Three

\dd Ay

\dt Four

\dd Bee

\dd Cee

\dd Dee

A-paragraph-full-of-hyphens-to-test-the-idea-that-word-wrapping-can-happen-somewhere-in-all-this-hyphenatory-nonsense.

A\-paragraph\-full\-of\-nonbreaking\-hyphens\-to\-test\-the\-idea\-that\-word\-wrapping\-misses\-them.

A\_paragraph\_full\_of\_nonbreaking\_spaces\_to\_test\_the\_idea\_that\_word\_wrapping\_misses\_them\_too.

Use of macros: let's talk about \coopt. And about \coopt some more.
And a nested macro: \metacoopt.

A slightly more difficult macro: \eur\.2500.

Test of input character set switching.

\n 8859 character in ASCII mode: expect nothing useful. [copt]

\cfg{input-charset}{ISO-8859-1}

\n 8859 character in 8859 mode: expect the right thing. [copt]

\cfg{input-charset}{UTF-8}

\n 8859 character in UTF-8 mode: expect the wrong thing. [copt]

\cfg{silliness}{coöpt}

\n UTF-8 sequence in UTF-8 mode: expect the right thing again. [coöpt]

\cfg{input-charset}{ASCII}

Back to ASCII again.

Oh, while I'm here: some special characters. The \\, \{ and \}
characters, to be precise. And their code equivalents, \c{\\},
\i\c{\{}, \c{\}}.  The ` and ' characters (grave and apostrophe)
are special in some output formats.

Now let's exercise the paper backends a little.  This is the entire
Adobe Standard Latin character set, which should be enough to cause
us to need to encode the main font twice:

\cfg{input-charset}{ISO-8859-1}

A        B C  D E      F G H I     J K L \u0141 M N  O   
\u0152    P Q R S \u0160 T  U     V W X Y  \u017d
a       &  ^ ~ * @  b \\ | \{ \} [ ]  \u2022
c \u02c7    \u02c6 : ,   d \u2020 \u2021    $ \u02d9 \u0131
e     8 \u2026 \u2014 \u2013 =  !  f \ufb01 5 \ufb02 \u0192 4 \u2044
g  \u2039 \u203a ` >   h - \u02dd i     j k l \u0142 < 
m \u2212 \u00B5  n 9  # o    \u0153  1       
p \u00b6 ( ) % \u2030 .  + 
q ?  " \u201e \u201c \u201d \u2018 \u2019 \u201a '
r  \u02da s \u0161 \u00A7 ; 7 6 /  t  3   \u02dc \u2122 2 
u     _ v w x y    z \u017e 0

\cfg{input-charset}{ASCII}

Testing ligatures in normal (fi), emphasised (\e{fi}), strong
(\s{fi}), code (\c{fi}) and weak code (\cw{fi}). The latter two should
not be ligated.

\c Also in a code paragraph (fi) with bold (fi) and italic (fi).
\e                                          bb              ii
\c There should be no ligation there.

The following pair of characters map to different glyphs with the same name in
some Microsoft TrueType fonts: \u0394{(missing)} \u2206{(missing)}

\S{subhead} First subheading

So here's a \I{subheading}\I{subsection}subsection. Just
incidentally, \q{this} is in quotes. \ii{Those} quotes had better work
in all formats.

We'll try for some Unicode here: \i{Schr\u00F6{oe}dinger}.

An index tag containing non-alternatived Unicode: \i{\u00BFChe?}

An invisible index tag: \I{she seems to have an invisible tag}yeah.

An index tag inside another tag: jackdaws love my \e{big \i{sphinx}}
of quartz.

Similarly, we should support things like hyperlinks
\e{\W{http://www.tartarus.org/}{at the beginning} of emphasised sections},
and \e{in the \W{http://www.tartarus.org/}{middle} of them}, and also
\e{at the \W{http://home.att.net/~cecw/lastpage.htm}{end}}.

Try that all over against with \c{\\s}: hyperlinks
\s{\W{http://www.tartarus.org/}{at the beginning} of strong sections},
and \s{in the \W{http://www.tartarus.org/}{middle} of them}, and also
\s{at the \W{http://home.att.net/~cecw/lastpage.htm}{end}}.

Here's a hyperlink containing some special characters:
\W{http://a<b&c>d/}{here}. (Not that it'll \e{work}, but you can at
least determine that it's been correctly escaped by inspection of
the output HTML.)

\#{FIXME: Unfortunately, we still don't quite do the right thing with
references:
How about a \e{reference to \k{subhead} here}? And at
\e{the end: \k{subhead}} and \e{\k{subhead}: the start}?
}

\S2{sub-sub}{Florble} Smaller heading still

A tiny section. Awww. How cute. Actually, this one's a \e{florble},
and here's a reference to it: \k{sub-sub}.

\A{app} Needless appendix

\# \cfg{winhelp-topic}{Y5VQEXZQVJ} (uncomment this and it clashes)

Here's an \i{appendix}, for no terribly good reason at all. See
__\k{book}__ (please excuse those underscores, I'm testing
whitespace).

It also contains a \W{http://www.tartarus.org/}{hyperlink}.

Also I'm going to index \i\c{-output} to ensure that its two
components are displayed as a joined-up code fragment in the index.

Here are \I{testone}some \I{testtwo}subsections \I{testthree}with
silly chapter titles and interesting use of Unicode. The Unicode
oddities are in the titles rather than the body text because that
way I get to test their handling in the PDF document outline.

\H{app-one} The 1024 \u00D7{x} 768 screen resolution

Err.

\H{app-two} How about Spongletech\u2122{(TM)}?

Umm.

\# I'm going to label one of these with a carefully chosen fragment
\# name "i1", because I know this will also be generated as an index
\# fragment name and this allows me to test the fragment name clash
\# detection.
\#
\# To actually run this test you need to configure html-leaf-level
\# to 0 and html-template-fragment to %k.

\H{i1} Or just Erd\u0151{\u00F6{o}}s?

Ahh.

\H{app-\\two} Section with inconvenient keyword

If you apply this file together with \cw{doc/chm.but}, this section
should test \cw{html_sanitise_filename()}.

\U Bibliography

\B{book} Some text describing a book.

\B{nocite} Some text describing a book. This text should appear in
the document even though there is no \cw{\\k} citing it.

\BR{book} [SillyCitation]
\BR{uncited} Badger.

\nocite{nocite}

\B{uncited} If this text appears, there's an actual error.

\# This is a comment.

\# Now for the index section.

\IM{she seems to have an invisible tag}{appendix} Invisible tags
and/or appendices

\# The display forms of these three index terms differ only in case.
\# This is a fiddly special case in the Windows Help backend,
\# because Windows Help's index mechanism is case-insensitive...

\IM{testone} Test
\IM{testtwo} TesT
\IM{testthree} test