Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Pod / Simple / Subclassing.pod
CommitLineData
3fea05b9 1
2=head1 NAME
3
4Pod::Simple::Subclassing -- write a formatter as a Pod::Simple subclass
5
6=head1 SYNOPSIS
7
8 package Pod::SomeFormatter;
9 use Pod::Simple;
10 @ISA = qw(Pod::Simple);
11 $VERSION = '1.01';
12 use strict;
13
14 sub _handle_element_start {
15 my($parser, $element_name, $attr_hash_r) = @_;
16 ...
17 }
18
19 sub _handle_element_end {
20 my($parser, $element_name) = @_;
21 ...
22 }
23
24 sub _handle_text {
25 my($parser, $text) = @_;
26 ...
27 }
28 1;
29
30=head1 DESCRIPTION
31
32This document is about using Pod::Simple to write a Pod processor,
33generally a Pod formatter. If you just want to know about using an
34existing Pod formatter, instead see its documentation and see also the
35docs in L<Pod::Simple>.
36
37The zeroeth step in writing a Pod formatter is to make sure that there
38isn't already a decent one in CPAN. See L<http://search.cpan.org/>, and
39run a search on the name of the format you want to render to. Also
40consider joining the Pod People list
41L<http://lists.perl.org/showlist.cgi?name=pod-people> and asking whether
42anyone has a formatter for that format -- maybe someone cobbled one
43together but just hasn't released it.
44
45The first step in writing a Pod processor is to read L<perlpodspec>,
46which contains notes information on writing a Pod parser (which has been
47largely taken care of by Pod::Simple), but also a lot of requirements
48and recommendations for writing a formatter.
49
50The second step is to actually learn the format you're planning to
51format to -- or at least as much as you need to know to represent Pod,
52which probably isn't much.
53
54The third step is to pick which of Pod::Simple's interfaces you want to
55use -- the basic interface via Pod::Simple or L<Pod::Simple::Methody> is
56event-based, sort of like L<HTML::Parser>'s interface, or sort of like
57L<XML::Parser>'s "Handlers" interface), but L<Pod::Simple::PullParser>
58provides a token-stream interface, sort of like L<HTML::TokeParser>'s
59interface; L<Pod::Simple::SimpleTree> provides a simple tree interface,
60rather like XML::Parser's "Tree" interface. Users familiar with
61XML-handling will find one of these styles relatively familiar; but if
62you would be even more at home with XML, there are classes that produce
63an XML representation of the Pod stream, notably
64L<Pod::Simple::XMLOutStream>; you can feed the output of such a class to
65whatever XML parsing system you are most at home with.
66
67The last step is to write your code based on how the events (or tokens,
68or tree-nodes, or the XML, or however you're parsing) will map to
69constructs in the output format. Also sure to consider how to escape
70text nodes containing arbitrary text, and also what to do with text
71nodes that represent preformatted text (from verbatim sections).
72
73
74
75=head1 Events
76
77TODO intro... mention that events are supplied for implicits, like for
78missing >'s
79
80
81In the following section, we use XML to represent the event structure
82associated with a particular construct. That is, TODO
83
84=over
85
86=item C<< $parser->_handle_element_start( I<element_name>, I<attr_hashref> ) >>
87
88=item C<< $parser->_handle_element_end( I<element_name> ) >>
89
90=item C<< $parser->_handle_text( I<text_string> ) >>
91
92=back
93
94TODO describe
95
96
97=over
98
99=item events with an element_name of Document
100
101Parsing a document produces this event structure:
102
103 <Document start_line="543">
104 ...all events...
105 </Document>
106
107The value of the I<start_line> attribute will be the line number of the first
108Pod directive in the document.
109
110If there is no Pod in the given document, then the
111event structure will be this:
112
113 <Document contentless="1" start_line="543">
114 </Document>
115
116In that case, the value of the I<start_line> attribute will not be meaningful;
117under current implementations, it will probably be the line number of the
118last line in the file.
119
120=item events with an element_name of Para
121
122Parsing a plain (non-verbatim, non-directive, non-data) paragraph in
123a Pod document produces this event structure:
124
125 <Para start_line="543">
126 ...all events in this paragraph...
127 </Para>
128
129The value of the I<start_line> attribute will be the line number of the start
130of the paragraph.
131
132For example, parsing this paragraph of Pod:
133
134 The value of the I<start_line> attribute will be the
135 line number of the start of the paragraph.
136
137produces this event structure:
138
139 <Para start_line="129">
140 The value of the
141 <I>
142 start_line
143 </I>
144 attribute will be the line number of the first Pod directive
145 in the document.
146 </Para>
147
148=item events with an element_name of B, C, F, or I.
149
150Parsing a BE<lt>...E<gt> formatting code (or of course any of its
151semantically identical syntactic variants
152S<BE<lt>E<lt> ... E<gt>E<gt>>,
153or S<BE<lt>E<lt>E<lt>E<lt> ... E<gt>E<gt>E<gt>E<gt>>, etc.)
154produces this event structure:
155
156 <B>
157 ...stuff...
158 </B>
159
160Currently, there are no attributes conveyed.
161
162Parsing C, F, or I codes produce the same structure, with only a
163different element name.
164
165If your parser object has been set to accept other formatting codes,
166then they will be presented like these B/C/F/I codes -- i.e., without
167any attributes.
168
169=item events with an element_name of S
170
171Normally, parsing an SE<lt>...E<gt> sequence produces this event
172structure, just as if it were a B/C/F/I code:
173
174 <S>
175 ...stuff...
176 </S>
177
178However, Pod::Simple (and presumably all derived parsers) offers the
179C<nbsp_for_S> option which, if enabled, will suppress all S events, and
180instead change all spaces in the content to non-breaking spaces. This is
181intended for formatters that output to a format that has no code that
182means the same as SE<lt>...E<gt>, but which has a code/character that
183means non-breaking space.
184
185=item events with an element_name of X
186
187Normally, parsing an XE<lt>...E<gt> sequence produces this event
188structure, just as if it were a B/C/F/I code:
189
190 <X>
191 ...stuff...
192 </X>
193
194However, Pod::Simple (and presumably all derived parsers) offers the
195C<nix_X_codes> option which, if enabled, will suppress all X events
196and ignore their content. For formatters/processors that don't use
197X events, this is presumably quite useful.
198
199
200=item events with an element_name of L
201
202Because the LE<lt>...E<gt> is the most complex construct in the
203language, it should not surprise you that the events it generates are
204the most complex in the language. Most of complexity is hidden away in
205the attribute values, so for those of you writing a Pod formatter that
206produces a non-hypertextual format, you can just ignore the attributes
207and treat an L event structure like a formatting element that
208(presumably) doesn't actually produce a change in formatting. That is,
209the content of the L event structure (as opposed to its
210attributes) is always what text should be displayed.
211
212There are, at first glance, three kinds of L links: URL, man, and pod.
213
214When a LE<lt>I<some_url>E<gt> code is parsed, it produces this event
215structure:
216
217 <L content-implicit="yes" to="that_url" type="url">
218 that_url
219 </L>
220
221The C<type="url"> attribute is always specified for this type of
222L code.
223
224For example, this Pod source:
225
226 L<http://www.perl.com/CPAN/authors/>
227
228produces this event structure:
229
230 <L content-implicit="yes" to="http://www.perl.com/CPAN/authors/" type="url">
231 http://www.perl.com/CPAN/authors/
232 </L>
233
234When a LE<lt>I<manpage(section)>E<gt> code is parsed (and these are
235fairly rare and not terribly useful), it produces this event structure:
236
237 <L content-implicit="yes" to="manpage(section)" type="man">
238 manpage(section)
239 </L>
240
241The C<type="man"> attribute is always specified for this type of
242L code.
243
244For example, this Pod source:
245
246 L<crontab(5)>
247
248produces this event structure:
249
250 <L content-implicit="yes" to="crontab(5)" type="man">
251 crontab(5)
252 </L>
253
254In the rare cases where a man page link has a specified, that text appears
255in a I<section> attribute. For example, this Pod source:
256
257 L<crontab(5)/"ENVIRONMENT">
258
259will produce this event structure:
260
261 <L content-implicit="yes" section="ENVIRONMENT" to="crontab(5)" type="man">
262 "ENVIRONMENT" in crontab(5)
263 </L>
264
265In the rare case where the Pod document has code like
266LE<lt>I<sometext>|I<manpage(section)>E<gt>, then the I<sometext> will appear
267as the content of the element, the I<manpage(section)> text will appear
268only as the value of the I<to> attribute, and there will be no
269C<content-implicit="yes"> attribute (whose presence means that the Pod parser
270had to infer what text should appear as the link text -- as opposed to
271cases where that attribute is absent, which means that the Pod parser did
272I<not> have to infer the link text, because that L code explicitly specified
273some link text.)
274
275For example, this Pod source:
276
277 L<hell itself!|crontab(5)>
278
279will produce this event structure:
280
281 <L to="crontab(5)" type="man">
282 hell itself!
283 </L>
284
285The last type of L structure is for links to/within Pod documents. It is
286the most complex because it can have a I<to> attribute, I<or> a
287I<section> attribute, or both. The C<type="pod"> attribute is always
288specified for this type of L code.
289
290In the most common case, the simple case of a LE<lt>podpageE<gt> code
291produces this event structure:
292
293 <L content-implicit="yes" to="Net::Ping" type="pod">
294 podpage
295 </L>
296
297For example, this Pod source:
298
299 L<Net::Ping>
300
301produces this event structure:
302
303 <L content-implicit="yes" to="Net::Ping" type="pod">
304 Net::Ping
305 </L>
306
307In cases where there is link-text explicitly specified, it
308is to be found in the content of the element (and not the
309attributes), just as with the LE<lt>I<sometext>|I<manpage(section)>E<gt>
310case discussed above. For example, this Pod source:
311
312 L<Perl Error Messages|perldiag>
313
314produces this event structure:
315
316 <L to="perldiag" type="pod">
317 Perl Error Messages
318 </L>
319
320In cases of links to a section in the current Pod document,
321there is a I<section> attribute instead of a I<to> attribute.
322For example, this Pod source:
323
324 L</"Member Data">
325
326produces this event structure:
327
328 <L content-implicit="yes" section="Member Data" type="pod">
329 "Member Data"
330 </L>
331
332As another example, this Pod source:
333
334 L<the various attributes|/"Member Data">
335
336produces this event structure:
337
338 <L section="Member Data" type="pod">
339 the various attributes
340 </L>
341
342In cases of links to a section in a different Pod document,
343there are both a I<section> attribute and a L<to> attribute.
344For example, this Pod source:
345
346 L<perlsyn/"Basic BLOCKs and Switch Statements">
347
348produces this event structure:
349
350 <L content-implicit="yes" section="Basic BLOCKs and Switch Statements" to="perlsyn" type="pod">
351 "Basic BLOCKs and Switch Statements" in perlsyn
352 </L>
353
354As another example, this Pod source:
355
356 L<SWITCH statements|perlsyn/"Basic BLOCKs and Switch Statements">
357
358produces this event structure:
359
360 <L section="Basic BLOCKs and Switch Statements" to="perlsyn" type="pod">
361 SWITCH statements
362 </L>
363
364Incidentally, note that we do not distinguish between these syntaxes:
365
366 L</"Member Data">
367 L<"Member Data">
368 L</Member Data>
369 L<Member Data> [deprecated syntax]
370
371That is, they all produce the same event structure, namely:
372
373 <L content-implicit="yes" section="Member Data" type="pod">
374 &#34;Member Data&#34;
375 </L>
376
377=item events with an element_name of E or Z
378
379While there are Pod codes EE<lt>...E<gt> and ZE<lt>E<gt>, these
380I<do not> produce any E or Z events -- that is, there are no such
381events as E or Z.
382
383=item events with an element_name of Verbatim
384
385When a Pod verbatim paragraph (AKA "codeblock") is parsed, it
386produces this event structure:
387
388 <Verbatim start_line="543" xml:space="preserve">
389 ...text...
390 </Verbatim>
391
392The value of the I<start_line> attribute will be the line number of the
393first line of this verbatim block. The I<xml:space> attribute is always
394present, and always has the value "preserve".
395
396The text content will have tabs already expanded.
397
398
399=item events with an element_name of head1 .. head4
400
401When a "=head1 ..." directive is parsed, it produces this event
402structure:
403
404 <head1>
405 ...stuff...
406 </head1>
407
408For example, a directive consisting of this:
409
410 =head1 Options to C<new> et al.
411
412will produce this event structure:
413
414 <head1 start_line="543">
415 Options to
416 <C>
417 new
418 </C>
419 et al.
420 </head1>
421
422"=head2" thru "=head4" directives are the same, except for the element
423names in the event structure.
424
425=item events with an element_name of over-bullet
426
427When an "=over ... Z<>=back" block is parsed where the items are
428a bulletted list, it will produce this event structure:
429
430 <over-bullet indent="4" start_line="543">
431 <item-bullet start_line="545">
432 ...Stuff...
433 </item-bullet>
434 ...more item-bullets...
435 </over-bullet>
436
437The value of the I<indent> attribute is whatever value is after the
438"=over" directive, as in "=over 8". If no such value is specified
439in the directive, then the I<indent> attribute has the value "4".
440
441For example, this Pod source:
442
443 =over
444
445 =item *
446
447 Stuff
448
449 =item *
450
451 Bar I<baz>!
452
453 =back
454
455produces this event structure:
456
457 <over-bullet indent="4" start_line="10">
458 <item-bullet start_line="12">
459 Stuff
460 </item-bullet>
461 <item-bullet start_line="14">
462 Bar <I>baz</I>!
463 </item-bullet>
464 </over-bullet>
465
466=item events with an element_name of over-number
467
468When an "=over ... Z<>=back" block is parsed where the items are
469a numbered list, it will produce this event structure:
470
471 <over-number indent="4" start_line="543">
472 <item-number number="1" start_line="545">
473 ...Stuff...
474 </item-number>
475 ...more item-number...
476 </over-bullet>
477
478This is like the "over-bullet" event structure; but note that the contents
479are "item-number" instead of "item-bullet", and note that they will have
480a "number" attribute, which some formatters/processors may ignore
481(since, for example, there's no need for it in HTML when producing
482an "<UL><LI>...</LI>...</UL>" structure), but which any processor may use.
483
484Note that the values for the I<number> attributes of "item-number"
485elements in a given "over-number" area I<will> start at 1 and go up by
486one each time. If the Pod source doesn't follow that order (even though
487it really should should!), whatever numbers it has will be ignored (with
488the correct values being put in the I<number> attributes), and an error
489message might be issued to the user.
490
491=item events with an element_name of over-text
492
493These events are are somewhat unlike the other over-*
494structures, as far as what their contents are. When
495an "=over ... Z<>=back" block is parsed where the items are
496a list of text "subheadings", it will produce this event structure:
497
498 <over-text indent="4" start_line="543">
499 <item-text>
500 ...stuff...
501 </item-text>
502 ...stuff (generally Para or Verbatim elements)...
503 <item-text>
504 ...more item-text and/or stuff...
505 </over-text>
506
507The I<indent> attribute is as with the other over-* events.
508
509For example, this Pod source:
510
511 =over
512
513 =item Foo
514
515 Stuff
516
517 =item Bar I<baz>!
518
519 Quux
520
521 =back
522
523produces this event structure:
524
525 <over-text indent="4" start_line="20">
526 <item-text start_line="22">
527 Foo
528 </item-text>
529 <Para start_line="24">
530 Stuff
531 </Para>
532 <item-text start_line="26">
533 Bar
534 <I>
535 baz
536 </I>
537 !
538 </item-text>
539 <Para start_line="28">
540 Quux
541 </Para>
542 </over-text>
543
544
545
546=item events with an element_name of over-block
547
548These events are are somewhat unlike the other over-*
549structures, as far as what their contents are. When
550an "=over ... Z<>=back" block is parsed where there are no items,
551it will produce this event structure:
552
553 <over-block indent="4" start_line="543">
554 ...stuff (generally Para or Verbatim elements)...
555 </over-block>
556
557The I<indent> attribute is as with the other over-* events.
558
559For example, this Pod source:
560
561 =over
562
563 For cutting off our trade with all parts of the world
564
565 For transporting us beyond seas to be tried for pretended offenses
566
567 He is at this time transporting large armies of foreign mercenaries to
568 complete the works of death, desolation and tyranny, already begun with
569 circumstances of cruelty and perfidy scarcely paralleled in the most
570 barbarous ages, and totally unworthy the head of a civilized nation.
571
572 =cut
573
574will produce this event structure:
575
576 <over-block indent="4" start_line="2">
577 <Para start_line="4">
578 For cutting off our trade with all parts of the world
579 </Para>
580 <Para start_line="6">
581 For transporting us beyond seas to be tried for pretended offenses
582 </Para>
583 <Para start_line="8">
584 He is at this time transporting large armies of [...more text...]
585 </Para>
586 </over-block>
587
588=item events with an element_name of item-bullet
589
590See L</"events with an element_name of over-bullet">, above.
591
592=item events with an element_name of item-number
593
594See L</"events with an element_name of over-number">, above.
595
596=item events with an element_name of item-text
597
598See L</"events with an element_name of over-text">, above.
599
600=item events with an element_name of for
601
602TODO...
603
604=item events with an element_name of Data
605
606TODO...
607
608=back
609
610
611
612=head1 More Pod::Simple Methods
613
614Pod::Simple provides a lot of methods that aren't generally interesting
615to the end user of an existing Pod formatter, but some of which you
616might find useful in writing a Pod formatter. They are listed below. The
617first several methods (the accept_* methods) are for declaring the
618capabilites of your parser, notably what C<=for I<targetname>> sections
619it's interested in, what extra NE<lt>...E<gt> codes it accepts beyond
620the ones described in the I<perlpod>.
621
622=over
623
624=item C<< $parser->accept_targets( I<SOMEVALUE> ) >>
625
626As the parser sees sections like:
627
628 =for html <img src="fig1.jpg">
629
630or
631
632 =begin html
633
634 <img src="fig1.jpg">
635
636 =end html
637
638...the parser will ignore these sections unless your subclass has
639specified that it wants to see sections targetted to "html" (or whatever
640the formatter name is).
641
642If you want to process all sections, even if they're not targetted for you,
643call this before you start parsing:
644
645 $parser->accept_targets('*');
646
647=item C<< $parser->accept_targets_as_text( I<SOMEVALUE> ) >>
648
649This is like accept_targets, except that it specifies also that the
650content of sections for this target should be treated as Pod text even
651if the target name in "=for I<targetname>" doesn't start with a ":".
652
653At time of writing, I don't think you'll need to use this.
654
655
656=item C<< $parser->accept_codes( I<Codename>, I<Codename>... ) >>
657
658This tells the parser that you accept additional formatting codes,
659beyond just the standard ones (I B C L F S X, plus the two weird ones
660you don't actually see in the parse tree, Z and E). For example, to also
661accept codes "N", "R", and "W":
662
663 $parser->accept_codes( qw( N R W ) );
664
665B<TODO: document how this interacts with =extend, and long element names>
666
667
668=item C<< $parser->accept_directive_as_data( I<directive_name> ) >>
669
670=item C<< $parser->accept_directive_as_verbatim( I<directive_name> ) >>
671
672=item C<< $parser->accept_directive_as_processed( I<directive_name> ) >>
673
674In the unlikely situation that you need to tell the parser that you will
675accept additional directives ("=foo" things), you need to first set the
676parset to treat its content as data (i.e., not really processed at
677all), or as verbatim (mostly just expanding tabs), or as processed text
678(parsing formatting codes like BE<lt>...E<gt>).
679
680For example, to accept a new directive "=method", you'd presumably
681use:
682
683 $parser->accept_directive_as_processed("method");
684
685so that you could have Pod lines like:
686
687 =method I<$whatever> thing B<um>
688
689Making up your own directives breaks compatibility with other Pod
690formatters, in a way that using "=for I<target> ..." lines doesn't;
691however, you may find this useful if you're making a Pod superset
692format where you don't need to worry about compatibility.
693
694
695=item C<< $parser->nbsp_for_S( I<BOOLEAN> ); >>
696
697Setting this attribute to a true value (and by default it is false) will
698turn "SE<lt>...E<gt>" sequences into sequences of words separated by
699C<\xA0> (non-breaking space) characters. For example, it will take this:
700
701 I like S<Dutch apple pie>, don't you?
702
703and treat it as if it were:
704
705 I like DutchE<nbsp>appleE<nbsp>pie, don't you?
706
707This is handy for output formats that don't have anything quite like an
708"SE<lt>...E<gt>" code, but which do have a code for non-breaking space.
709
710There is currently no method for going the other way; but I can
711probably provide one upon request.
712
713
714=item C<< $parser->version_report() >>
715
716This returns a string reporting the $VERSION value from your module (and
717its classname) as well as the $VERSION value of Pod::Simple. Note that
718L<perlpodspec> requires output formats (wherever possible) to note
719this detail in a comment in the output format. For example, for
720some kind of SGML output format:
721
722 print OUT "<!-- \n", $parser->version_report, "\n -->";
723
724
725=item C<< $parser->pod_para_count() >>
726
727This returns the count of Pod paragraphs seen so far.
728
729
730=item C<< $parser->line_count() >>
731
732This is the current line number being parsed. But you might find the
733"line_number" event attribute more accurate, when it is present.
734
735
736=item C<< $parser->nix_X_codes( I<SOMEVALUE> ) >>
737
738This attribute, when set to a true value (and it is false by default)
739ignores any "XE<lt>...E<gt>" sequences in the document being parsed.
740Many formats don't actually use the content of these codes, so have
741no reason to process them.
742
743
744=item C<< $parser->merge_text( I<SOMEVALUE> ) >>
745
746This attribute, when set to a true value (and it is false by default)
747makes sure that only one event (or token, or node) will be created
748for any single contiguous sequence of text. For example, consider
749this somewhat contrived example:
750
751 I just LOVE Z<>hotE<32>apple pie!
752
753When that is parsed and events are about to be called on it, it may
754actually seem to be four different text events, one right after another:
755one event for "I just LOVE ", one for "hot", one for " ", and one for
756"apple pie!". But if you have merge_text on, then you're guaranteed
757that it will be fired as one text event: "I just LOVE hot apple pie!".
758
759
760=item C<< $parser->code_handler( I<CODE_REF> ) >>
761
762This specifies code that should be called when a code line is seen
763(i.e., a line outside of the Pod). Normally this is undef, meaning
764that no code should be called. If you provide a routine, it should
765start out like this:
766
767 sub get_code_line { # or whatever you'll call it
768 my($line, $line_number, $parser) = @_;
769 ...
770 }
771
772Note, however, that sometimes the Pod events aren't processed in exactly
773the same order as the code lines are -- i.e., if you have a file with
774Pod, then code, then more Pod, sometimes the code will be processed (via
775whatever you have code_handler call) before the all of the preceding Pod
776has been processed.
777
778
779=item C<< $parser->cut_handler( I<CODE_REF> ) >>
780
781This is just like the code_handler attribute, except that it's for
782"=cut" lines, not code lines. The same caveats apply. "=cut" lines are
783unlikely to be interesting, but this is included for completeness.
784
785
786=item C<< $parser->whine( I<linenumber>, I<complaint string> ) >>
787
788This notes a problem in the Pod, which will be reported to in the "Pod
789Errors" section of the document and/or send to STDERR, depending on the
790values of the attributes C<no_whining>, C<no_errata_section>, and
791C<complain_stderr>.
792
793=item C<< $parser->scream( I<linenumber>, I<complaint string> ) >>
794
795This notes an error like C<whine> does, except that it is not
796suppressable with C<no_whining>. This should be used only for very
797serious errors.
798
799
800=item C<< $parser->source_dead(1) >>
801
802This aborts parsing of the current document, by switching on the flag
803that indicates that EOF has been seen. In particularly drastic cases,
804you might want to do this. It's rather nicer than just calling
805C<die>!
806
807=item C<< $parser->hide_line_numbers( I<SOMEVALUE> ) >>
808
809Some subclasses that indescriminately dump event attributes (well,
810except for ones beginning with "~") can use this object attribute for
811refraining to dump the "start_line" attribute.
812
813=item C<< $parser->no_whining( I<SOMEVALUE> ) >>
814
815This attribute, if set to true, will suppress reports of non-fatal
816error messages. The default value is false, meaning that complaints
817I<are> reported. How they get reported depends on the values of
818the attributes C<no_errata_section> and C<complain_stderr>.
819
820=item C<< $parser->no_errata_section( I<SOMEVALUE> ) >>
821
822This attribute, if set to true, will suppress generation of an errata
823section. The default value is false -- i.e., an errata section will be
824generated.
825
826=item C<< $parser->complain_stderr( I<SOMEVALUE> ) >>
827
828This attribute, if set to true will send complaints to STDERR. The
829default value is false -- i.e., complaints do not go to STDERR.
830
831=item C<< $parser->bare_output( I<SOMEVALUE> ) >>
832
833Some formatter subclasses use this as a flag for whether output should
834have prologue and epilogue code omitted. For example, setting this to
835true for an HTML formatter class should omit the
836"<html><head><title>...</title><body>..." prologue and the
837"</body></html>" epilogue.
838
839If you want to set this to true, you should probably also set
840C<no_whining> or at least C<no_errata_section> to true.
841
842=item C<< $parser->preserve_whitespace( I<SOMEVALUE> ) >>
843
844If you set this attribute to a true value, the parser will try to
845preserve whitespace in the output. This means that such formatting
846conventions as two spaces after periods will be preserved by the parser.
847This is primarily useful for output formats that treat whitespace as
848significant (such as text or *roff, but not HTML).
849
850=back
851
852
853=head1 SEE ALSO
854
855L<Pod::Simple> -- event-based Pod-parsing framework
856
857L<Pod::Simple::Methody> -- like Pod::Simple, but each sort of event
858calls its own method (like C<start_head3>)
859
860L<Pod::Simple::PullParser> -- a Pod-parsing framework like Pod::Simple,
861but with a token-stream interface
862
863L<Pod::Simple::SimpleTree> -- a Pod-parsing framework like Pod::Simple,
864but with a tree interface
865
866L<Pod::Simple::Checker> -- a simple Pod::Simple subclass that reads
867documents, and then makes a plaintext report of any errors found in the
868document
869
870L<Pod::Simple::DumpAsXML> -- for dumping Pod documents as tidily
871indented XML, showing each event on its own line
872
873L<Pod::Simple::XMLOutStream> -- dumps a Pod document as XML (without
874introducing extra whitespace as Pod::Simple::DumpAsXML does).
875
876L<Pod::Simple::DumpAsText> -- for dumping Pod documents as tidily
877indented text, showing each event on its own line
878
879L<Pod::Simple::LinkSection> -- class for objects representing the values
880of the TODO and TODO attributes of LE<lt>...E<gt> elements
881
882L<Pod::Escapes> -- the module the Pod::Simple uses for evaluating
883EE<lt>...E<gt> content
884
885L<Pod::Simple::Text> -- a simple plaintext formatter for Pod
886
887L<Pod::Simple::TextContent> -- like Pod::Simple::Text, but
888makes no effort for indent or wrap the text being formatted
889
890L<perlpod|perlpod>
891
892L<perlpodspec|perlpodspec>
893
894L<perldoc>
895
896
897=head1 COPYRIGHT AND DISCLAIMERS
898
899Copyright (c) 2002 Sean M. Burke. All rights reserved.
900
901This library is free software; you can redistribute it and/or modify it
902under the same terms as Perl itself.
903
904This program is distributed in the hope that it will be useful, but
905without any warranty; without even the implied warranty of
906merchantability or fitness for a particular purpose.
907
908=head1 AUTHOR
909
910Sean M. Burke C<sburke@cpan.org>
911
912
913=for notes
914Hm, my old podchecker version (1.2) says:
915 *** WARNING: node 'http://search.cpan.org/' contains non-escaped | or / at line 38 in file Subclassing.pod
916 *** WARNING: node 'http://lists.perl.org/showlist.cgi?name=pod-people' contains non-escaped | or / at line 41 in file Subclassing.pod
917Yes, L<...> is hard.
918
919
920=cut
921
922