.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{
. if \nF \{
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "Pod::2::DocBook 3pm"
.TH Pod::2::DocBook 3pm "2015-06-08" "perl v5.20.2" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
Pod::2::DocBook \- Convert Pod data to DocBook SGML
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 9
\& use Pod::2::DocBook;
\& my $parser = Pod::2::DocBook\->new(
\& title => \*(AqMy Article\*(Aq,
\& doctype => \*(Aqarticle\*(Aq,
\& base_id => \*(Aqarticle42\*(Aq
\& fix_double_quotes => 1,
\& spaces => 3,
\& id_version => 2,
\& );
\&
\& $parser\->parse_from_file (\*(Aqmy_article.pod\*(Aq, \*(Aqmy_article.sgml\*(Aq);
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
Pod::2::DocBook is a module for translating Pod-formatted documents to
DocBook 4.2 \s-1SGML \s0(see ). It is primarily a
back end for \fBpod2docbook\fR, but, as a Pod::Parser subclass, it can be
used on its own. The only public extensions to the Pod::Parser
interface are options available to \f(CW\*(C`new()\*(C'\fR:
.IP "doctype" 4
.IX Item "doctype"
This option sets the output document's doctype. The currently
supported types are \fBarticle\fR, \fBchapter\fR, \fBrefentry\fR and
\&\fBsection\fR. Special processing is performed when the doctype is set
to \fBrefentry\fR (see \*(L"Document Types\*(R"). You \fImust\fR set this option
in order to get valid DocBook output.
.IP "fix_double_quotes" 4
.IX Item "fix_double_quotes"
If this option is set to a true value, pairs of double quote
characters ('"') in ordinary paragraphs will be replaced with
\&\fB\fR and \fB\fR. See \*(L"Ordinary
Paragraphs\*(R" for details.
.IP "header" 4
.IX Item "header"
If this option is set to a true value, Pod::2::DocBook will emit a
\&\s-1DOCTYPE\s0 as the first line of output.
.IP "spaces" 4
.IX Item "spaces"
Pod::2::DocBook produces pretty-printed output. This option sets the
number of spaces per level of indentation in the output.
.IP "title" 4
.IX Item "title"
This option sets the output document's title.
.PP
The rest of this document only describes issues specific to
Pod::2::DocBook; for details on invoking the parser, specifically the
\&\f(CW\*(C`new()\*(C'\fR, \f(CW\*(C`parse_from_file()\*(C'\fR and \f(CW\*(C`parse_from_filehandle()\*(C'\fR methods,
see Pod::Parser.
.SH "METHODS"
.IX Header "METHODS"
.Vb 1
\& use base \*(AqPod::Parser\*(Aq;
.Ve
.SS "\fIinitialize()\fP"
.IX Subsection "initialize()"
Initialize parser.
.SS "\fIbegin_pod()\fP"
.IX Subsection "begin_pod()"
Output docbook header stuff.
.SS "\fIend_pod()\fP"
.IX Subsection "end_pod()"
Output docbook footer. Will print also errors if any in a comment block.
.ie n .SS "commans($command, $paragraph, $line_num)"
.el .SS "commans($command, \f(CW$paragraph\fP, \f(CW$line_num\fP)"
.IX Subsection "commans($command, $paragraph, $line_num)"
Process \s-1POD\s0 commands.
.ie n .SS "textblock ($paragraph, $line_num)"
.el .SS "textblock ($paragraph, \f(CW$line_num\fP)"
.IX Subsection "textblock ($paragraph, $line_num)"
Process text block.
.ie n .SS "verbatim($paragraph, $line_num)"
.el .SS "verbatim($paragraph, \f(CW$line_num\fP)"
.IX Subsection "verbatim($paragraph, $line_num)"
Process verbatim text block.
.ie n .SS "interior_sequence($command, $argument, $seq)"
.el .SS "interior_sequence($command, \f(CW$argument\fP, \f(CW$seq\fP)"
.IX Subsection "interior_sequence($command, $argument, $seq)"
Process formatting commands.
.SS "error_msg"
.IX Subsection "error_msg"
Returns parser error message(s) if any occured.
.SS "make_id($text)"
.IX Subsection "make_id($text)"
default id format \-
.PP
Function will construct an element id string. Id string is composed of
\&\f(CW\*(C`join (\*(Aq:\*(Aq, $parser\->{base_id}, $text)\*(C'\fR, where \f(CW$text\fR in most cases
is the pod heading text.
.PP
version 2 id format \-
.PP
having ':' in id was not a best choice. (Xerces complains \- Attribute value
\&\*(L"lib.Moose.Manual.pod:NAME\*(R" of type \s-1ID\s0 must be an NCName when namespaces are
enabled.) To not break backwards compatibity switch with \fI> in
constructor for using '\-' instead.
.PP
The xml id string has strict format. Checkout \*(L"cleanup_id\*(R" function for
specification.
.SS "make_uniq_id($text)"
.IX Subsection "make_uniq_id($text)"
Calls \f(CW\*(C`$parser\->make_id($text)\*(C'\fR and checks if such id was already
generated. If so, generates new one by adding _i1 (or _i2, i3, ...) to the id
string. Return value is new uniq id string.
.SS "cleanup_id($id_string)"
.IX Subsection "cleanup_id($id_string)"
This function is used internally to remove/change any illegal characters
from the elements id string. (see http://www.w3.org/TR/2000/REC\-xml\-20001006#NT\-Name
for the id string specification)
.PP
.Vb 6
\& $id_string =~ s//$1/g; # keep just inside of CDATA
\& $id_string =~ s/<.+?>//g; # remove tags
\& $id_string =~ s/^\es*//; # ltrim spaces
\& $id_string =~ s/\es*$//; # rtrim spaces
\& $id_string =~ tr{/ }{._}; # replace / with . and spaces with _
\& $id_string =~ s/[^\e\-_a\-zA\-Z0\-9\e.: ]//g; # closed set of characters allowed in id string
.Ve
.PP
In the worst case when the \f(CW$id_string\fR after clean up will not conform with
the specification, warning will be printed out and random number with leading colon
will be used.
.SH "POD TO DOCBOOK TRANSLATION"
.IX Header "POD TO DOCBOOK TRANSLATION"
Pod is a deceptively simple format; it is easy to learn and very
straightforward to use, but it is suprisingly expressive.
Nevertheless, it is not nearly as expressive or complex as DocBook.
In most cases, given some Pod, the analogous DocBook markup is
obvious, but not always. This section describes how Pod::2::DocBook
treats Pod input so that Pod authors may make informed choices. In
every case, Pod::2::DocBook strives to make easy things easy and hard
things possible.
.PP
The primary motivation behind Pod::2::DocBook is to facilitate
single-source publishing. That is, you should be able to generate man
pages, web pages, \s-1PDF\s0 and PostScript documents, or any other format
your \s-1SGML\s0 and/or Pod tools can produce, from the same Pod source,
without the need for hand-editing any intermediate files. This may
not always be possible, or you may simply choose to render Pod to
DocBook and use that as your single source. To satisfy the first
requirement, Pod::2::DocBook always processes the entire Pod source and
tries very hard to produce valid DocBook markup, even in the presence
of malformed Pod (see \*(L"\s-1DIAGNOSTICS\*(R"\s0). To satisfy the second
requirement (and to be a little nifty), Pod::2::DocBook pretty-prints its
output. If you're curious about what specific output to expect, read
on.
.SS "Document Types"
.IX Subsection "Document Types"
DocBook's structure is very modular; many of its document types can be
embedded directly into other documents. Accordingly, Pod::2::DocBook
will generate four different document types: \fBarticle\fR, \fBchapter\fR,
\&\fBrefentry\fR, and \fBsection\fR. This makes it easy, for instance, to
write all the chapters of a book in separate Pod documents, translate
them into DocBook markup and later glue them together before
processing the entire book. You could do the same with each section
in an article, or you could write the entire article in a single Pod
document. Other document types, such as \fBbook\fR and \fBset\fR, do not
map easily from Pod, because they require structure for which there is
no Pod equivalent. But given sections and chapters, making larger
documents becomes much simpler.
.PP
The \fBrefentry\fR document type is a little different from the others.
Sections, articles, and chapters are essentially composed of nested
sections. But a refentry has specialized elements for the \fI\s-1NAME\s0\fR and
\&\fI\s-1SYNOPSIS\s0\fR sections. To accommodate this, Pod::2::DocBook performs
extra processing on the Pod source when the \fBdoctype\fR is set to
\&\fBrefentry\fR. You probably don't have to do anything to your document
to assist the processing; typical man page conventions cover the
requirements. Just make sure that the \fI\s-1NAME\s0\fR and \fI\s-1SYNOPSIS\s0\fR headers
are both \fB=head1\fRs, that \*(L"\s-1NAME\*(R"\s0 and \*(L"\s-1SYNOPSIS\*(R"\s0 are both uppercase,
and that \fB=head1 \s-1NAME\s0\fR is the first line of Pod source.
.SS "Ordinary Paragraphs"
.IX Subsection "Ordinary Paragraphs"
Ordinary paragraphs in a Pod document translate naturally to DocBook
paragraphs. Specifically, after any formatting codes are processed,
the characters \f(CW\*(C`<\*(C'\fR, \f(CW\*(C`>\*(C'\fR and \f(CW\*(C`&\*(C'\fR are translated to
their respective \s-1SGML\s0 character entities, and the paragraph is wrapped
in \fB\fR and \fB\fR.
.PP
For example, given this Pod paragraph:
.PP
.Vb 1
\& Here is some text with I & an ampersand.
.Ve
.PP
Pod::2::DocBook would produce DocBook markup similar to this:
.PP
.Vb 4
\&
\& Here is some text with italics
\& & an ampersand.
\&
.Ve
.PP
Depending on your final output format, you may sometimes want double
quotes in ordinary paragraphs to show up ultimately as \*(L"smart quotes\*(R"
(little 66s and 99s). Pod::2::DocBook offers a convenient mechanism for
handling double quotes in ordinary paragraphs and letting your \s-1SGML\s0
toolchain manage their presentation: the \fBfix_double_quotes\fR option
to \f(CW\*(C`new()\*(C'\fR. If this option is set to a true value, Pod::2::DocBook will
replace pairs of double quotes in ordinary paragraphs (and \fIonly\fR in
ordinary paragraphs) with \fB\fR and \fB\fR.
.PP
For example, given this Pod paragraph:
.PP
.Vb 1
\& Here is some text with I & an "ampersand".
.Ve
.PP
Pod::2::DocBook, with \fBfix_double_quotes\fR set, would produce DocBook
markup similar to this:
.PP
.Vb 4
\&
\& Here is some text with italics
\& & an ampersand.
\&
.Ve
.PP
If you have a paragraph with an odd number of double quotes, the last
one will be left untouched, which may or may not be what you want. If
you have such a document, replace the unpaired double quote character
with \fBE\fR, and Pod::2::DocBook should be able to give
you the output you expect. Also, if you have any
\&\fB=begin\ docbook\fR ... \fB=end\ docbook\fR regions (see
\&\*(L"Embedded DocBook Markup\*(R") in your Pod, you are responsible for
managing your own quotes in those regions.
.SS "Verbatim Paragraphs"
.IX Subsection "Verbatim Paragraphs"
Verbatim paragraphs translate even more naturally; perlpodspec
mandates that absolutely no processing should be performed on them.
So Pod::2::DocBook simply marks them as \s-1CDATA\s0 and wraps them in
\&\fB\fR and \fB\fR. They are not indented
the way ordinary paragraphs are, because they treat whitespace as
significant.
.PP
For example, given this verbatim paragraph (imagine there's leading
whitespace in the source):
.PP
.Vb 4
\& my $i = 10;
\& while (<> && $i\-\-) {
\& print "$i: $_";
\& }
.Ve
.PP
Pod::2::DocBook would produce DocBook markup similar to this:
.PP
.Vb 4
\& && $i\-\-) {
\& print "$i: $_";
\& }]] >
.Ve
.PP
Multiple contiguous verbatim paragraphs are treated as a single
\&\fIscreen\fR element, with blank lines separating the paragraphs, as
dictated by perlpodspec.
.SS "Command Paragraphs"
.IX Subsection "Command Paragraphs"
.ie n .IP """=head1 Heading Text""" 4
.el .IP "\f(CW=head1 Heading Text\fR" 4
.IX Item "=head1 Heading Text"
.PD 0
.ie n .IP """=head2 Heading Text""" 4
.el .IP "\f(CW=head2 Heading Text\fR" 4
.IX Item "=head2 Heading Text"
.ie n .IP """=head3 Heading Text""" 4
.el .IP "\f(CW=head3 Heading Text\fR" 4
.IX Item "=head3 Heading Text"
.ie n .IP """=head4 Heading Text""" 4
.el .IP "\f(CW=head4 Heading Text\fR" 4
.IX Item "=head4 Heading Text"
.PD
All of the Pod heading commands produce DocBook \fIsection\fR elements,
with the heading text as titles. Pod::2::DocBook (perlpod) only
allows for 4 heading levels, but DocBook allows arbitrary nesting; see
\&\*(L"Embedded DocBook Markup\*(R" if you need more than 4 levels.
Pod::2::DocBook only looks at relative heading levels to determine
nesting. For example, this bit of Pod:
.Sp
.Vb 1
\& =head1 1
\&
\& Contents of section 1
\&
\& =head2 1.1
\&
\& Contents of section 1.1
.Ve
.Sp
and this bit of Pod:
.Sp
.Vb 1
\& =head1 1
\&
\& Contents of section 1
\&
\& =head3 1.1
\&
\& Contents of section 1.1
.Ve
.Sp
both produce the same DocBook markup, which will look something like
this:
.Sp
.Vb 10
\& 1
\&
\& Contents of section 1
\&
\& 1.1
\&
\& Contents of section 1.1
\&
\&
\&
.Ve
.Sp
Note that Pod::2::DocBook automatically generates section identifiers
from your doctype, document title and section title. It does the same
when you make internal links (see \*(L"Formatting Codes\*(R", ensuring that
if you supply the same link text as you did for the section title, the
resulting identifiers will be the same.
.ie n .IP """=over indentlevel""" 4
.el .IP "\f(CW=over indentlevel\fR" 4
.IX Item "=over indentlevel"
.PD 0
.ie n .IP """=item stuff...""" 4
.el .IP "\f(CW=item stuff...\fR" 4
.IX Item "=item stuff..."
.ie n .IP """=back""" 4
.el .IP "\f(CW=back\fR" 4
.IX Item "=back"
.PD
\&\f(CW\*(C`=over\*(C'\fR ... \f(CW\*(C`=back\*(C'\fR regions are somewhat complex, in that they can
lead to a variety of DocBook constructs. In every case,
\&\fIindentlevel\fR is ignored by Pod::2::DocBook, since that's best left to
your stylesheets.
.Sp
An \f(CW\*(C`=over\*(C'\fR ... \f(CW\*(C`=back\*(C'\fR region with no \f(CW\*(C`=item\*(C'\fRs represents indented
text and maps directly to a DocBook \fIblockquote\fR element. Given this
source:
.Sp
.Vb 1
\& =over 4
\&
\& This text should be indented.
\&
\& =back
.Ve
.Sp
Pod::2::DocBook will produce DocBook markup similar to this:
.Sp
.Vb 5
\&
\&
\& This text should be indented.
\&
\&
.Ve
.Sp
Inside an \f(CW\*(C`=over\*(C'\fR ... \f(CW\*(C`=back\*(C'\fR region, \f(CW\*(C`=item\*(C'\fR commands generate
lists. The text that follows the first \f(CW\*(C`=item\*(C'\fR determines the type
of list that will be output:
.RS 4
.IP "\(bu" 4
\&\*(L"*\*(R" (an asterisk) produces \fB\fR
.IP "\(bu" 4
\&\*(L"1\*(R" or \*(L"1.\*(R" produces \fB\fR
.IP "\(bu" 4
\&\*(L"a\*(R" or \*(L"a.\*(R" produces \fB\fR
.IP "\(bu" 4
\&\*(L"A\*(R" or \*(L"A.\*(R" produces \fB\fR
.IP "\(bu" 4
\&\*(L"i\*(R" or \*(L"i.\*(R" produces \fB\fR
.IP "\(bu" 4
\&\*(L"I\*(R" or \*(L"I.\*(R" produces \fB\fR
.IP "\(bu" 4
anything else produces \fB\fR
.RE
.RS 4
.Sp
Since the output from each of these is relatively verbose, the best
way to see examples is to actually render some Pod into DocBook.
.RE
.ie n .IP """=pod""" 4
.el .IP "\f(CW=pod\fR" 4
.IX Item "=pod"
.PD 0
.ie n .IP """=cut""" 4
.el .IP "\f(CW=cut\fR" 4
.IX Item "=cut"
.PD
Pod::Parser recognizes these commands, and, therefore, so does
Pod::2::DocBook, but they don't produce any output.
.ie n .IP """=begin formatname""" 4
.el .IP "\f(CW=begin formatname\fR" 4
.IX Item "=begin formatname"
.PD 0
.ie n .IP """=end formatname""" 4
.el .IP "\f(CW=end formatname\fR" 4
.IX Item "=end formatname"
.ie n .IP """=for formatname text...""" 4
.el .IP "\f(CW=for formatname text...\fR" 4
.IX Item "=for formatname text..."
.PD
Pod::2::DocBook supports two formats: \fBdocbook\fR, explained in
\&\*(L"Embedded DocBook Markup\*(R", and \fBtable\fR, explained in \*(L"Simple
Tables\*(R".
.ie n .IP """=encoding encodingname""" 4
.el .IP "\f(CW=encoding encodingname\fR" 4
.IX Item "=encoding encodingname"
This command is currently not supported. If Pod::2::DocBook encounters a
document that contains \f(CW\*(C`=encoding\*(C'\fR, it will ignore the command and
report an error (\*(L"unknown command `%s' at line \f(CW%d\fR in file \f(CW%s\fR\*(R").
.PP
\fIEmbedded DocBook Markup\fR
.IX Subsection "Embedded DocBook Markup"
.PP
There are a wide range of DocBook structures for which there is no Pod
equivalent. For these, you will have to provide your own markup using
\&\fB=begin docbook\fR ... \fB=end docbook\fR or \fB=for docbook ...\fR.
Pod::2::DocBook will directly output whatever text you provide,
unprocessed, so it's up to you to ensure that it's valid DocBook.
.PP
Images, footnotes and many inline elements are obvious candidates for
embedded markup. Another possible use is nesting sections more than
four-deep. For example, given this source:
.PP
.Vb 1
\& =head1 1
\&
\& This is Section 1
\&
\& =head2 1.1
\&
\& This is Section 1.1
\&
\& =head3 1.1.1
\&
\& This is Section 1.1.1
\&
\& =head4 1.1.1.1
\&
\& This is Section 1.1.1.1
\&
\& =begin docbook
\&
\&
\& 1.1.1.1.1
\& This is Section 1.1.1.1.1
\&
\&
\& =end docbook
.Ve
.PP
Pod::2::DocBook will generate DocBook markup similar to this:
.PP
.Vb 10
\& 1
\&
\& This is Section 1
\&
\& 1.1
\&
\& This is Section 1.1
\&
\& 1.1.1
\&
\& This is Section 1.1.1
\&
\& 1.1.1.1
\&
\& This is Section 1.1.1.1
\&
\&
\& 1.1.1.1.1
\& This is Section 1.1.1.1.1
\&
\&
\&
\&
\&
.Ve
.PP
\fISimple Tables\fR
.IX Subsection "Simple Tables"
.PP
Pod::2::DocBook also provides a mechanism for generating basic tables
with \fB=begin\ table\fR and \fB=end\ docbook\fR. If you have
simple tabular data or a \s-1CSV\s0 file exported from some application,
Pod::2::DocBook makes it easy to generate a table from your data. The
syntax is intended to be simple, so DocBook's entire table feature set
is not represented, but even if you do need more complex table markup
than Pod::2::DocBook produces, you can rapidly produce some markup which
you can hand-edit and then embed directly in your Pod with
\&\fB=begin\ docbook\fR ... \fB=end\ docbook\fR. Each table
definition spans multiple lines, so there is no equivalent
\&\fB=for\ table\fR command.
.PP
The first line of a table definition gives the table's title. The
second line gives a list of comma-separated column specifications
(really just column alignments), each of which can be \fBleft\fR,
\&\fBcenter\fR or \fBright\fR. The third line is a list of comma-separated
column headings, and every subsequent line consists of comma-separated
row data. If any of your data actually contain commas, you can
enclose them in double quotes; if they also contain double quotes, you
must escape the inner quotes with backslashes (typical \s-1CSV\s0 stuff).
.PP
Here's an example:
.PP
.Vb 1
\& =begin table
\&
\& Sample Table
\& left,center,right
\& Powers of Ten,Planets,Dollars
\& 10,Earth,$1
\& 100,Mercury,$5
\& 1000,Mars,$10
\& 10000,Venus,$20
\& 100000,"Jupiter, Saturn",$50
\&
\& =end table
.Ve
.PP
And here's what Pod::2::DocBook would do with it:
.PP
.Vb 10
\&
.Ve
.SS "Formatting Codes"
.IX Subsection "Formatting Codes"
Pod formatting codes render directly into DocBook as inline elements:
.IP "\(bu" 4
\&\f(CW\*(C`I\*(C'\fR
.Sp
.Vb 1
\& text
.Ve
.IP "\(bu" 4
\&\f(CW\*(C`B\*(C'\fR
.Sp
.Vb 1
\& text
.Ve
.IP "\(bu" 4
\&\f(CW\*(C`C\*(C'\fR
.Sp
.Vb 1
\&
.Ve
.IP "\(bu" 4
\&\f(CW\*(C`L\*(C'\fR
.Sp
.Vb 1
\& name
.Ve
.IP "\(bu" 4
\&\f(CW\*(C`L\*(C'\fR
.Sp
.Vb 2
\& name
\& n
.Ve
.IP "\(bu" 4
\&\f(CW\*(C`L\*(C'\fR or \f(CW\*(C`L\*(C'\fR
.Sp
.Vb 2
\& sec in
\& name
.Ve
.IP "\(bu" 4
\&\f(CW\*(C`L\*(C'\fR or \f(CW\*(C`L\*(C'\fR
.Sp
.Vb 3
\& sec in
\& namen
\&
.Ve
.IP "\(bu" 4
\&\f(CW\*(C`L"sec">\*(C'\fR or \f(CW\*(C`L\*(C'\fR or \f(CW\*(C`L<"sec">\*(C'\fR
.Sp
.Vb 1
\& sec
.Ve
.IP "\(bu" 4
\&\f(CW\*(C`L\*(C'\fR
.Sp
.Vb 1
\& text
.Ve
.IP "\(bu" 4
\&\f(CW\*(C`L\*(C'\fR or \f(CW\*(C`L\*(C'\fR
.Sp
.Vb 1
\& text
.Ve
.IP "\(bu" 4
\&\f(CW\*(C`L\*(C'\fR or \f(CW\*(C`L\*(C'\fR or \f(CW\*(C`L\*(C'\fR
.Sp
.Vb 1
\& text
.Ve
.IP "\(bu" 4
\&\f(CW\*(C`L\*(C'\fR
.Sp
.Vb 1
\& scheme:...
.Ve
.IP "\(bu" 4
\&\f(CW\*(C`E\*(C'\fR
.Sp
.Vb 1
\& |
.Ve
.IP "\(bu" 4
\&\f(CW\*(C`E\*(C'\fR
.Sp
.Vb 1
\& /
.Ve
.IP "\(bu" 4
\&\f(CW\*(C`E\*(C'\fR
.Sp
.Vb 1
\& number;
.Ve
.IP "\(bu" 4
any other \f(CW\*(C`E\*(C'\fR
.Sp
.Vb 1
\& &escape;
.Ve
.IP "\(bu" 4
\&\f(CW\*(C`F\*(C'\fR
.Sp
filename
.IP "\(bu" 4
\&\f(CW\*(C`S\*(C'\fR
.Sp
.Vb 1
\& text with spaces
.Ve
.IP "\(bu" 4
\&\f(CW\*(C`X\*(C'\fR
.Sp
topic name
.SH "DIAGNOSTICS"
.IX Header "DIAGNOSTICS"
Pod::2::DocBook makes every possible effort to produce valid DocBook
markup, even with malformed \s-1POD\s0 source. Any processing errors will be
noted in comments at the end of the output document. Even when errors
occur, Pod::2::DocBook always reads the entire input document and never
exits with a non-zero status.
.ie n .IP "unknown command `%s' at line %d in file %s" 4
.el .IP "unknown command `%s' at line \f(CW%d\fR in file \f(CW%s\fR" 4
.IX Item "unknown command `%s' at line %d in file %s"
See \*(L"Command Paragraph\*(R" in perlpod for a list of valid commands. The
command referenced in the error message was ignored.
.ie n .IP "formatting code `%s' nested within `%s' at line %d in file %s" 4
.el .IP "formatting code `%s' nested within `%s' at line \f(CW%d\fR in file \f(CW%s\fR" 4
.IX Item "formatting code `%s' nested within `%s' at line %d in file %s"
See \*(L"Formatting Codes\*(R" in perlpod for details on which formatting codes
can be nested. The offending code was translated into the output
document as the raw text inside its angle brackets.
.ie n .IP "unknown formatting code `%s' at line in file %s" 4
.el .IP "unknown formatting code `%s' at line in file \f(CW%s\fR" 4
.IX Item "unknown formatting code `%s' at line in file %s"
The input contained a formatting code not listed in perlpod; it was
translated into the output document as the raw text inside the angle
brackets.
.ie n .IP "empty L<> at line %d in file %s" 4
.el .IP "empty L<> at line \f(CW%d\fR in file \f(CW%s\fR" 4
.IX Item "empty L<> at line %d in file %s"
Self-explanatory.
.ie n .IP "invalid escape `%s' at line %d in file %s" 4
.el .IP "invalid escape `%s' at line \f(CW%d\fR in file \f(CW%s\fR" 4
.IX Item "invalid escape `%s' at line %d in file %s"
Self-explanatory; it was translated into the output document as the
raw text inside the angle brackets.
.ie n .IP "=item must be inside an =over ... =back section at line %d in file %s" 4
.el .IP "=item must be inside an =over ... =back section at line \f(CW%d\fR in file \f(CW%s\fR" 4
.IX Item "=item must be inside an =over ... =back section at line %d in file %s"
Self-explanatory. The `=item' referenced in the error was ignored.
.ie n .IP "`=end %s' found but current region opened with `=begin %s'" 4
.el .IP "`=end \f(CW%s\fR' found but current region opened with `=begin \f(CW%s\fR'" 4
.IX Item "`=end %s' found but current region opened with `=begin %s'"
The closest `=end' command to the referenced `=begin' didn't match;
processing continued as if the mismatched `=end' wasn't there.
.ie n .IP "no matching `=end' for `=begin %s'" 4
.el .IP "no matching `=end' for `=begin \f(CW%s\fR'" 4
.IX Item "no matching `=end' for `=begin %s'"
Pod::2::DocBook reached the end of its input without finding an `=end'
command to match the `=begin' referenced in the error; end-of-file
processing continued.
.ie n .IP "unknown colspec `%s' in table at line %d in file %s" 4
.el .IP "unknown colspec `%s' in table at line \f(CW%d\fR in file \f(CW%s\fR" 4
.IX Item "unknown colspec `%s' in table at line %d in file %s"
See \*(L"Simple Tables\*(R" for a list of supported column specifications.
.IP "encountered unknown state `%s' (this should never happen)" 4
.IX Item "encountered unknown state `%s' (this should never happen)"
The state referred to is an internal variable used to properly manage
nested DocBook structures. You should indeed never see this message,
but if you do, you should contact the module's author.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
pod2docbook, perlpod, Pod::DocBook,
\&\s-1SVN\s0 repo \- ,
,
\&\fIdoc/\fR + \fIexamples/pod2docbook\-docbook/\fR for Pod::2::DocBook
DocBook documentation
.PP
DocBook related links: ,
,
.SH "AUTHOR"
.IX Header "AUTHOR"
Alligator Descartes wrote a module called
Pod::2::DocBook, which was later maintained by Jan Iven
. That module was based on the original pod2html
by Tom Christiansen .
.PP
Nandu Shah wrote Pod::DocBook, which is
unrelated to the previous module (even though they both perform the
same function). ()
.PP
Jozef Kutej renamed the module to Pod::2::DocBook
because Nandus version was buried in the \s-1CPAN\s0 archive as an
\&\*(L"\s-1UNAUTHORIZED RELEASE\*(R".\s0
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright 2004, Nandu Shah
.PP
Copyright 2008, Jozef Kutej
.PP
This library is free software; you may redistribute it and/or modify
it under the same terms as Perl itself