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