Upgrade to podlators 1.14.
[p5sagit/p5-mst-13.2.git] / lib / Pod / t / basic.man
1 .UC
2 .SH "NAME"
3 basic.pod \- Test of various basic \s-1POD\s0 features in translators.
4 .SH "HEADINGS"
5 .IX Header "HEADINGS"
6 Try a few different levels of headings, with embedded formatting codes and
7 other interesting bits.
8 .ie n .SH "This ""is"" a ""level 1"" heading"
9 .el .SH "This \f(CWis\fP a ``level 1'' heading"
10 .IX Header "This is a level 1 heading"
11 .Sh "``Level'' ""2 \fIheading\fP"
12 .IX Subsection "``Level'' ""2 heading"
13 \fILevel 3 \f(BIheading \f(BIwith \f(CB\*(C`weird \f(CBstuff "" (double quote)\f(CB\*(C'\f(BI\f(BI\fI\fR
14 .IX Subsection "Level 3 heading with weird stuff """" (double quote)"
15 .PP
16 Level "4 \f(CW\*(C`heading\*(C'\fR
17 .IX Subsection "Level ""4 heading"
18 .PP
19 Now try again with \fBintermixed\fR \fItext\fR.
20 .ie n .SH "This ""is"" a ""level 1"" heading"
21 .el .SH "This \f(CWis\fP a ``level 1'' heading"
22 .IX Header "This is a level 1 heading"
23 Text.
24 .Sh "``Level'' 2 \fIheading\fP"
25 .IX Subsection "``Level'' 2 heading"
26 Text.
27 .PP
28 \fILevel 3 \f(BIheading \f(BIwith \f(CB\*(C`weird \f(CBstuff\f(CB\*(C'\f(BI\f(BI\fI\fR
29 .IX Subsection "Level 3 heading with weird stuff"
30 .PP
31 Text.
32 .PP
33 Level "4 \f(CW\*(C`heading\*(C'\fR
34 .IX Subsection "Level ""4 heading"
35 .PP
36 Text.
37 .SH "LINKS"
38 .IX Header "LINKS"
39 These are all taken from the Pod::Parser tests.
40 .PP
41 Try out \fI\s-1LOTS\s0\fR of different ways of specifying references:
42 .PP
43 Reference the \*(L"section\*(R" in manpage
44 .PP
45 Reference the \*(L"section\*(R" in manpage
46 .PP
47 Reference the \*(L"section\*(R" in manpage
48 .PP
49 Reference the \*(L"section\*(R" in manpage
50 .PP
51 Reference the \*(L"manpage/section\*(R"
52 .PP
53 Reference the \*(L"section\*(R" in \*(L"manpage\*(R"
54 .PP
55 Reference the \*(L"section\*(R" in manpage
56 .PP
57 Reference the \*(L"section\*(R" in manpage
58 .PP
59 Reference the \*(L"section\*(R" in manpage
60 .PP
61 Now try it using the new \*(L"|\*(R" stuff ...
62 .PP
63 Reference the thistext|
64 .PP
65 Reference the thistext |
66 .PP
67 Reference the thistext|
68 .PP
69 Reference the thistext |
70 .PP
71 Reference the thistext|
72 .PP
73 Reference the thistext |
74 .PP
75 Reference the thistext|
76 .PP
77 Reference the thistext|
78 .PP
79 Reference the thistext |
80 .PP
81 And then throw in a few new ones of my own.
82 .PP
83 foo
84 .PP
85 foo
86 .PP
87 \&\*(L"bar\*(R" in foo
88 .PP
89 \&\*(L"baz boo\*(R" in foo
90 .PP
91 \&\*(L"bar\*(R"
92 .PP
93 \&\*(L"baz boo\*(R"
94 .PP
95 \&\*(L"baz boo\*(R"
96 .PP
97 \&\*(L"baz boo\*(R" in foo bar
98 .PP
99 \&\*(L"baz boo\*(R" in foo bar
100 .PP
101 \&\*(L"boo\*(R" in foo bar baz
102 .PP
103 \&\*(L"boo var baz\*(R"
104 .PP
105 \&\*(L"bar baz\*(R"
106 .PP
107 \&\*(L"boo bar baz / baz boo\*(R"
108 .PP
109 \&\*(L"boo\*(R", \*(L"bar\*(R", and \*(L"baz\*(R"
110 .PP
111 foo\&bar
112 .PP
113 Testing \fIitalics\fR
114 .PP
115 "\fIItalic\fR text" in foo
116 .PP
117 "Section \f(CW\*(C`with\*(C'\fR \fI\f(BIother\fI markup\fR" in foo|bar\&
118 .PP
119 Nested <http://www.perl.org/>
120 .SH "OVER AND ITEMS"
121 .IX Header "OVER AND ITEMS"
122 Taken from Pod::Parser tests, this is a test to ensure that multiline
123 =item paragraphs get indented appropriately.
124 .IP "This is a test." 4
125 .IX Item "This is a test."
126 .PP
127 There should be whitespace now before this line.
128 .PP
129 Taken from Pod::Parser tests, this is a test to ensure the nested =item
130 paragraphs get indented appropriately.
131 .IP "1" 2
132 .IX Item "1"
133 First section.
134 .RS 2
135 .IP "a" 2
136 .IX Item "a"
137 this is item a
138 .IP "b" 2
139 .IX Item "b"
140 this is item b
141 .RE
142 .RS 2
143 .RE
144 .IP "2" 2
145 .IX Item "2"
146 Second section.
147 .RS 2
148 .IP "a" 2
149 .IX Item "a"
150 this is item a
151 .IP "b" 2
152 .IX Item "b"
153 this is item b
154 .IP "c" 2
155 .IX Item "c"
156 .PD 0
157 .IP "d" 2
158 .IX Item "d"
159 .PD
160 This is item c & d.
161 .RE
162 .RS 2
163 .RE
164 .PP
165 Now some additional weirdness of our own.  Make sure that multiple tags
166 for one paragraph are properly compacted.
167 .ie n .IP """foo""" 4
168 .el .IP "``foo''" 4
169 .IX Item "foo"
170 .PD 0
171 .IP "\fBbar\fR" 4
172 .IX Item "bar"
173 .ie n .IP """baz""" 4
174 .el .IP "\f(CWbaz\fR" 4
175 .IX Item "baz"
176 .PD
177 There shouldn't be any spaces between any of these item tags; this idiom
178 is used in perlfunc.
179 .IP "Some longer item text" 4
180 .IX Item "Some longer item text"
181 Just to make sure that we test paragraphs where the item text doesn't fit
182 in the margin of the paragraph (and make sure that this paragraph fills a
183 few lines).
184 .Sp
185 Let's also make it multiple paragraphs to be sure that works.
186 .PP
187 Test use of =over without =item as a block \*(L"quote\*(R" or block paragraph.
188 .Sp
189 .RS 4
190 This should be indented four spaces but otherwise formatted the same as
191 any other regular text paragraph.  Make sure it's long enough to see the
192 results of the formatting.....
193 .RE
194 .PP
195 Now try the same thing nested, and make sure that the indentation is reset
196 back properly.
197 .RS 4
198 .Sp
199 .RS 4
200 This paragraph should be doubly indented.
201 .RE
202 .RE
203 .RS 4
204 .Sp
205 This paragraph should only be singly indented.
206 .IP "\(bu" 4
207 This is an item in the middle of a block\-quote, which should be allowed.
208 .IP "\(bu" 4
209 We're also testing tagless item commands.
210 .RE
211 .RS 4
212 .Sp
213 Should be back to the single level of indentation.
214 .RE
215 .PP
216 Should be back to regular indentation.
217 .PP
218 Now also check the transformation of * into real bullets for man pages.
219 .IP "\(bu" 4
220 An item.  We're also testing using =over without a number, and making sure
221 that item text wraps properly.
222 .IP "\(bu" 4
223 Another item.
224 .PP
225 and now test the numbering of item blocks.
226 .IP "1." 4
227 First item.
228 .IP "2." 4
229 Second item.
230 .SH "FORMATTING CODES"
231 .IX Header "FORMATTING CODES"
232 Another test taken from Pod::Parser.
233 .PP
234 This is a test to see if I can do not only \f(CW$self\fR and \f(CW\*(C`method()\*(C'\fR, but
235 also \f(CW\*(C`$self\->method()\*(C'\fR and \f(CW\*(C`$self\->{FIELDNAME}\*(C'\fR and
236 \&\f(CW\*(C`$Foo <=> $Bar\*(C'\fR without resorting to escape sequences. If 
237 I want to refer to the right-shift operator I can do something
238 like \f(CW\*(C`$x >> 3\*(C'\fR or even \f(CW\*(C`$y >> 5\*(C'\fR.
239 .PP
240 Now for the grand finale of \f(CW\*(C`$self\->method()\->{FIELDNAME} = {FOO=>BAR}\*(C'\fR.
241 And I also want to make sure that newlines work like this
242 \&\f(CW\*(C`$self\->{FOOBAR} >> 3 and [$b => $a]\->[$a <=> $b]\*(C'\fR
243 .PP
244 Of course I should still be able to do all this \fIwith\fR escape sequences
245 too: \f(CW\*(C`$self\->method()\*(C'\fR and \f(CW\*(C`$self\->{FIELDNAME}\*(C'\fR and
246 \&\f(CW\*(C`{FOO=>BAR}\*(C'\fR.
247 .PP
248 Dont forget \f(CW\*(C`$self\->method()\->{FIELDNAME} = {FOO=>BAR}\*(C'\fR.
249 .PP
250 And make sure that \f(CW0\fR works too!
251 .PP
252 Now, if I use << or >> as my delimiters, then I have to use whitespace.
253 So things like \f(CW\*(C`<$self\-\*(C'\fR\fImethod()\fR>> and \f(CW\*(C`<$self\-\*(C'\fR{\s-1FIELDNAME\s0}>> wont end
254 up doing what you might expect since the first > will still terminate
255 the first < seen.
256 .PP
257 Lets make sure these work for empty ones too, like  and \f(CW\*(C`>>\*(C'\fR
258 (just to be obnoxious)
259 .PP
260 The statement: \f(CW\*(C`This is dog kind's \f(CIfinest\f(CW hour!\*(C'\fR is a parody of a
261 quotation from Winston Churchill.
262 .PP
263 The following tests are added to those:
264 .PP
265 Make sure that a few oth\&er odd \fI\&things\fR still work.  This should be
266 a vertical bar:  |.  Here's a test of a few more special escapes
267 that have to be supported:
268 .IP "&" 3
269 An ampersand.
270 .IP "'" 3
271 An apostrophe.
272 .IP "<" 3
273 A less-than sign.
274 .IP ">" 3
275 A greater-than sign.
276 .IP """" 3
277 A double quotation mark.
278 .IP "/" 3
279 A forward slash.
280 .PP
281 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
282 |same\ thing\ with\ non-breaking\ spaces.|
283 .PP
284 There is a soft hyphen in hyphen at hy\-phen.
285 .PP
286 This is a test of an index entry.
287 .IX Xref "index entry"
288 .SH "VERBATIM"
289 .IX Header "VERBATIM"
290 Throw in a few verbatim paragraphs.
291 .PP
292 .Vb 8
293 \&    use Term::ANSIColor;
294 \&    print color 'bold blue';
295 \&    print "This text is bold blue.\en";
296 \&    print color 'reset';
297 \&    print "This text is normal.\en";
298 \&    print colored ("Yellow on magenta.\en", 'yellow on_magenta');
299 \&    print "This text is normal.\en";
300 \&    print colored ['yellow on_magenta'], "Yellow on magenta.\en";
301 .Ve
302 .Vb 2
303 \&    use Term::ANSIColor qw(uncolor);
304 \&    print uncolor '01;31', "\en";
305 .Ve
306 But this isn't verbatim (make sure it wraps properly), and the next
307 paragraph is again:
308 .PP
309 .Vb 2
310 \&    use Term::ANSIColor qw(:constants);
311 \&    print BOLD, BLUE, "This text is in bold blue.\en", RESET;
312 .Ve
313 .Vb 1
314 \&    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";
315 .Ve
316 (Ugh, that's obnoxiously long.)  Try different spacing:
317 .PP
318 .Vb 7
319 \&        Starting with a tab.
320 \&Not
321 \&starting
322 \&with
323 \&a
324 \&tab.  But this should still be verbatim.
325 \& As should this.
326 .Ve
327 This isn't.
328 .PP
329 .Vb 2
330 \& This is.  And this:    is an internal tab.  It should be:
331 \&                    |--| <= lined up with that.
332 .Ve
333 (Tricky, but tabs should be expanded before the translator starts in on
334 the text since otherwise text with mixed tabs and spaces will get messed
335 up.)