summaryrefslogtreecommitdiff
path: root/lib/Pod/t/basic.man
blob: c5d8c14f89b468c513757de1d7d2bf947d661178 (plain)
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
.SH "NAME"
basic.pod \- Test of various basic POD features in translators.
.SH "HEADINGS"
.IX Header "HEADINGS"
Try a few different levels of headings, with embedded formatting codes and
other interesting bits.
.ie n .SH "This ""is"" a ""level 1"" heading"
.el .SH "This \f(CWis\fP a ``level 1'' heading"
.IX Header "This is a level 1 heading"
.Sh "``Level'' ""2 \fIheading\fP"
.IX Subsection "``Level'' ""2 heading"
\fILevel 3 \f(BIheading \f(BIwith \f(CB\*(C`weird \f(CBstuff "" (double quote)\f(CB\*(C'\f(BI\f(BI\fI\fR
.IX Subsection "Level 3 heading with weird stuff """" (double quote)"
.PP
Level "4 \f(CW\*(C`heading\*(C'\fR
.IX Subsection "Level ""4 heading"
.PP
Now try again with \fBintermixed\fR \fItext\fR.
.ie n .SH "This ""is"" a ""level 1"" heading"
.el .SH "This \f(CWis\fP a ``level 1'' heading"
.IX Header "This is a level 1 heading"
Text.
.Sh "``Level'' 2 \fIheading\fP"
.IX Subsection "``Level'' 2 heading"
Text.
.PP
\fILevel 3 \f(BIheading \f(BIwith \f(CB\*(C`weird \f(CBstuff\f(CB\*(C'\f(BI\f(BI\fI\fR
.IX Subsection "Level 3 heading with weird stuff"
.PP
Text.
.PP
Level "4 \f(CW\*(C`heading\*(C'\fR
.IX Subsection "Level ""4 heading"
.PP
Text.
.SH "LINKS"
.IX Header "LINKS"
These are all taken from the Pod::Parser tests.
.PP
Try out \fI\s-1LOTS\s0\fR of different ways of specifying references:
.PP
Reference the \*(L"section\*(R" in manpage
.PP
Reference the \*(L"section\*(R" in manpage
.PP
Reference the \*(L"section\*(R" in manpage
.PP
Reference the \*(L"section\*(R" in manpage
.PP
Reference the \*(L"manpage/section\*(R"
.PP
Reference the \*(L"section\*(R" in \*(L"manpage\*(R"
.PP
Reference the \*(L"section\*(R" in manpage
.PP
Reference the \*(L"section\*(R" in manpage
.PP
Reference the \*(L"section\*(R" in manpage
.PP
Now try it using the new \*(L"|\*(R" stuff ...
.PP
Reference the thistext|
.PP
Reference the thistext |
.PP
Reference the thistext|
.PP
Reference the thistext |
.PP
Reference the thistext|
.PP
Reference the thistext |
.PP
Reference the thistext|
.PP
Reference the thistext|
.PP
Reference the thistext |
.PP
And then throw in a few new ones of my own.
.PP
foo
.PP
foo
.PP
\&\*(L"bar\*(R" in foo
.PP
\&\*(L"baz boo\*(R" in foo
.PP
\&\*(L"bar\*(R"
.PP
\&\*(L"baz boo\*(R"
.PP
\&\*(L"baz boo\*(R"
.PP
\&\*(L"baz boo\*(R" in foo bar
.PP
\&\*(L"baz boo\*(R" in foo bar
.PP
\&\*(L"boo\*(R" in foo bar baz
.PP
\&\*(L"boo var baz\*(R"
.PP
\&\*(L"bar baz\*(R"
.PP
\&\*(L"boo bar baz / baz boo\*(R"
.PP
\&\*(L"boo\*(R", \*(L"bar\*(R", and \*(L"baz\*(R"
.PP
foo\&bar
.PP
Testing \fIitalics\fR
.PP
"\fIItalic\fR text" in foo
.PP
"Section \f(CW\*(C`with\*(C'\fR \fI\f(BIother\fI markup\fR" in foo|bar\&
.PP
Nested <http://www.perl.org/>
.SH "OVER AND ITEMS"
.IX Header "OVER AND ITEMS"
Taken from Pod::Parser tests, this is a test to ensure that multiline
=item paragraphs get indented appropriately.
.IP "This is a test." 4
.IX Item "This is a test."
.PP
There should be whitespace now before this line.
.PP
Taken from Pod::Parser tests, this is a test to ensure the nested =item
paragraphs get indented appropriately.
.IP "1" 2
.IX Item "1"
First section.
.RS 2
.IP "a" 2
.IX Item "a"
this is item a
.IP "b" 2
.IX Item "b"
this is item b
.RE
.RS 2
.RE
.IP "2" 2
.IX Item "2"
Second section.
.RS 2
.IP "a" 2
.IX Item "a"
this is item a
.IP "b" 2
.IX Item "b"
this is item b
.IP "c" 2
.IX Item "c"
.PD 0
.IP "d" 2
.IX Item "d"
.PD
This is item c & d.
.RE
.RS 2
.RE
.PP
Now some additional weirdness of our own.  Make sure that multiple tags
for one paragraph are properly compacted.
.ie n .IP """foo""" 4
.el .IP "``foo''" 4
.IX Item "foo"
.PD 0
.IP "\fBbar\fR" 4
.IX Item "bar"
.ie n .IP """baz""" 4
.el .IP "\f(CWbaz\fR" 4
.IX Item "baz"
.PD
There shouldn't be any spaces between any of these item tags; this idiom
is used in perlfunc.
.IP "Some longer item text" 4
.IX Item "Some longer item text"
Just to make sure that we test paragraphs where the item text doesn't fit
in the margin of the paragraph (and make sure that this paragraph fills a
few lines).
.Sp
Let's also make it multiple paragraphs to be sure that works.
.PP
Test use of =over without =item as a block \*(L"quote\*(R" or block paragraph.
.Sp
.RS 4
This should be indented four spaces but otherwise formatted the same as
any other regular text paragraph.  Make sure it's long enough to see the
results of the formatting.....
.RE
.PP
Now try the same thing nested, and make sure that the indentation is reset
back properly.
.RS 4
.Sp
.RS 4
This paragraph should be doubly indented.
.RE
.RE
.RS 4
.Sp
This paragraph should only be singly indented.
.IP "\(bu" 4
This is an item in the middle of a block\-quote, which should be allowed.
.IP "\(bu" 4
We're also testing tagless item commands.
.RE
.RS 4
.Sp
Should be back to the single level of indentation.
.RE
.PP
Should be back to regular indentation.
.PP
Now also check the transformation of * into real bullets for man pages.
.IP "\(bu" 4
An item.  We're also testing using =over without a number, and making sure
that item text wraps properly.
.IP "\(bu" 4
Another item.
.PP
and now test the numbering of item blocks.
.IP "1." 4
First item.
.IP "2." 4
Second item.
.SH "FORMATTING CODES"
.IX Header "FORMATTING CODES"
Another test taken from Pod::Parser.
.PP
This is a test to see if I can do not only \f(CW$self\fR and \f(CW\*(C`method()\*(C'\fR, but
also \f(CW\*(C`$self\->method()\*(C'\fR and \f(CW\*(C`$self\->{FIELDNAME}\*(C'\fR and
\&\f(CW\*(C`$Foo <=> $Bar\*(C'\fR without resorting to escape sequences. If 
I want to refer to the right-shift operator I can do something
like \f(CW\*(C`$x >> 3\*(C'\fR or even \f(CW\*(C`$y >> 5\*(C'\fR.
.PP
Now for the grand finale of \f(CW\*(C`$self\->method()\->{FIELDNAME} = {FOO=>BAR}\*(C'\fR.
And I also want to make sure that newlines work like this
\&\f(CW\*(C`$self\->{FOOBAR} >> 3 and [$b => $a]\->[$a <=> $b]\*(C'\fR
.PP
Of course I should still be able to do all this \fIwith\fR escape sequences
too: \f(CW\*(C`$self\->method()\*(C'\fR and \f(CW\*(C`$self\->{FIELDNAME}\*(C'\fR and
\&\f(CW\*(C`{FOO=>BAR}\*(C'\fR.
.PP
Dont forget \f(CW\*(C`$self\->method()\->{FIELDNAME} = {FOO=>BAR}\*(C'\fR.
.PP
And make sure that \f(CW0\fR works too!
.PP
Now, if I use << or >> as my delimiters, then I have to use whitespace.
So things like \f(CW\*(C`<$self\-\*(C'\fR\fImethod()\fR>> and \f(CW\*(C`<$self\-\*(C'\fR{\s-1FIELDNAME\s0}>> wont end
up doing what you might expect since the first > will still terminate
the first < seen.
.PP
Lets make sure these work for empty ones too, like  and \f(CW\*(C`>>\*(C'\fR
(just to be obnoxious)
.PP
The statement: \f(CW\*(C`This is dog kind's \f(CIfinest\f(CW hour!\*(C'\fR is a parody of a
quotation from Winston Churchill.
.PP
The following tests are added to those:
.PP
Make sure that a few oth\&er odd \fI\&things\fR still work.  This should be
a vertical bar:  |.  Here's a test of a few more special escapes
that have to be supported:
.IP "&" 3
An ampersand.
.IP "'" 3
An apostrophe.
.IP "<" 3
A less-than sign.
.IP ">" 3
A greater-than sign.
.IP """" 3
A double quotation mark.
.IP "/" 3
A forward slash.
.PP
Try to get this bit of text over towards the edge so |that\ all\ of\ this\ text\ inside\ S<>\ won't| be wrapped.  Also test the
|same\ thing\ with\ non-breaking\ spaces.|
.PP
There is a soft hyphen in hyphen at hy\-phen.
.PP
This is a test of an index entry.
.IX Xref "index entry"
.SH "VERBATIM"
.IX Header "VERBATIM"
Throw in a few verbatim paragraphs.
.PP
.Vb 8
\&    use Term::ANSIColor;
\&    print color 'bold blue';
\&    print "This text is bold blue.\en";
\&    print color 'reset';
\&    print "This text is normal.\en";
\&    print colored ("Yellow on magenta.\en", 'yellow on_magenta');
\&    print "This text is normal.\en";
\&    print colored ['yellow on_magenta'], "Yellow on magenta.\en";
.Ve
.PP
.Vb 2
\&    use Term::ANSIColor qw(uncolor);
\&    print uncolor '01;31', "\en";
.Ve
.PP
But this isn't verbatim (make sure it wraps properly), and the next
paragraph is again:
.PP
.Vb 2
\&    use Term::ANSIColor qw(:constants);
\&    print BOLD, BLUE, "This text is in bold blue.\en", RESET;
.Ve
.PP
.Vb 1
\&    use Term::ANSIColor qw(:constants); $Term::ANSIColor::AUTORESET = 1; print BOLD BLUE "This text is in bold blue.\en"; print "This text is normal.\en";
.Ve
.PP
(Ugh, that's obnoxiously long.)  Try different spacing:
.PP
.Vb 7
\&        Starting with a tab.
\&Not
\&starting
\&with
\&a
\&tab.  But this should still be verbatim.
\& As should this.
.Ve
.PP
This isn't.
.PP
.Vb 2
\& This is.  And this:    is an internal tab.  It should be:
\&                    |--| <= lined up with that.
.Ve
.PP
(Tricky, but tabs should be expanded before the translator starts in on
the text since otherwise text with mixed tabs and spaces will get messed
up.)
.PP
.Vb 5
\&    And now we test verbatim paragraphs right before a heading.  Older
\&    versions of Pod::Man generated two spaces between paragraphs like this
\&    and the heading.  (In order to properly test this, one may have to
\&    visually inspect the nroff output when run on the generated *roff
\&    text, unfortunately.)
.Ve
.SH "CONCLUSION"
.IX Header "CONCLUSION"
That's all, folks!