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