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