.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" 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 >0, 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::Simple::Pandoc 3pm" .TH Pod::Simple::Pandoc 3pm "2022-01-20" "perl v5.32.1" "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::Simple::Pandoc \- convert Pod to Pandoc document model .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Pod::Simple::Pandoc; \& \& my $parser = Pod::Simple::Pandoc\->new( %options ); \& my $doc = $parser\->parse_file( $filename ); \& \& # result is a Pandoc::Document object \& my $json = $doc\->to_json; \& my $markdown = $doc\->to_pandoc( \-t => \*(Aqmarkdown\*(Aq ); \& $doc\->to_pandoc(qw( \-o doc.html \-\-standalone )); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module converts Pod format (perlpod) to the document model used by Pandoc . The result can be accessed with methods of Pandoc::Elements and further processed with Pandoc to convert it to other document formats (\s-1HTML,\s0 Markdown, LaTeX, \s-1PDF, EPUB,\s0 docx, \s-1ODT,\s0 man...). .PP See pod2pandoc and App::pod2pandoc for a command line script and a simplified \s-1API\s0 to this module. .SH "OPTIONS" .IX Header "OPTIONS" .IP "parse" 4 .IX Item "parse" Parse Pod data sections with Pandoc and merge them into the document instead of passing them as \f(CW\*(C`RawBlock\*(C'\fR. Use \f(CW\*(C`*\*(C'\fR to parse all formats supported by pandoc as input format. Expects an array reference otherwise. .IP "podurl" 4 .IX Item "podurl" Base \s-1URL\s0 to link Perl module names to. Set to by default. A false value disables linking external modules and wraps module names in \f(CW\*(C`Span\*(C'\fR elements instead. All module names are marked up with class \&\f(CW\*(C`perl\-module\*(C'\fR. .SH "METHODS" .IX Header "METHODS" .ie n .SS "parse_file( $filename | *INPUT )" .el .SS "parse_file( \f(CW$filename\fP | *INPUT )" .IX Subsection "parse_file( $filename | *INPUT )" Reads Pod from file or filehandle and convert it to a Pandoc::Document. The filename is put into document metadata field \f(CW\*(C`file\*(C'\fR and the module name. The \&\s-1NAME\s0 section, if given, is additionally split into metadata fields \f(CW\*(C`title\*(C'\fR and \&\f(CW\*(C`subtitle\*(C'\fR. .ie n .SS "parse_module( $module )" .el .SS "parse_module( \f(CW$module\fP )" .IX Subsection "parse_module( $module )" Reads Pod from a module given by name such as \f(CW"Pod::Pandoc"\fR or by \s-1URL.\s0 .ie n .SS "parse_string( $string )" .el .SS "parse_string( \f(CW$string\fP )" .IX Subsection "parse_string( $string )" Reads Pod from string and convert it to a Pandoc::Document. Also sets metadata fields \f(CW\*(C`title\*(C'\fR and \f(CW\*(C`subtitle\*(C'\fR. .ie n .SS "parse_dir( $directory )" .el .SS "parse_dir( \f(CW$directory\fP )" .IX Subsection "parse_dir( $directory )" Recursively looks for \f(CW\*(C`.pm\*(C'\fR and \f(CW\*(C`.pod\*(C'\fR files in a given directory and parses them. Returns a hash reference with filenames mapped to Pandoc::Document objects. Each document is enriched with metadata fields \f(CW\*(C`base\*(C'\fR (relative path from each file to the base directory) in addition to \f(CW\*(C`file\*(C'\fR, \f(CW\*(C`title\*(C'\fR, and \&\f(CW\*(C`subtitle\*(C'\fR. .ie n .SS "parse_modules( $directory, [ quiet => 0|1 ] )" .el .SS "parse_modules( \f(CW$directory\fP, [ quiet => 0|1 ] )" .IX Subsection "parse_modules( $directory, [ quiet => 0|1 ] )" Same as method \f(CW\*(C`parse_dir\*(C'\fR but returns a Pod::Simple::Pandoc::Modules instance that maps module names to Pandoc::Document instances. The source directory can also be specified with option \f(CW\*(C`source\*(C'\fR. Option \f(CW\*(C`quiet\*(C'\fR disables warnings for skipped files. .ie n .SS "parse_and_merge( @files_or_modules )" .el .SS "parse_and_merge( \f(CW@files_or_modules\fP )" .IX Subsection "parse_and_merge( @files_or_modules )" Reads Pod from files or modules given by name and merges them into one Pandoc::Document by concatenation. .SH "MAPPING" .IX Header "MAPPING" Pod elements are mapped to Pandoc elements as following: .SS "Formatting codes" .IX Subsection "Formatting codes" Formatting codes for \fIitalic text\fR (\f(CW\*(C`I<...>\*(C'\fR), \fBbold text\fR (\f(CW\*(C`B<...>\*(C'\fR), and \f(CW\*(C`code\*(C'\fR (\f(CW\*(C`C<...>\*(C'\fR) are mapped to Emphasized text (\f(CW\*(C`Emph\*(C'\fR), strongly emphasized text (\f(CW\*(C`Strong\*(C'\fR), and inline code (\f(CW\*(C`Code\*(C'\fR). Formatting code for \&\fIfilenames\fR (\f(CW\*(C`F<...>\*(C'\fR) are mapped to inline code with class \&\f(CW\*(C`filename\*(C'\fR (\f(CW\*(C`\`...\`{.filename}\*(C'\fR in Pandoc Markdown). Formatting codes inside code and filenames (e.g. \f(CW\*(C`code with \f(CBbold\f(CW\*(C'\fR or \fI\fR as filename) are stripped to unformatted code. Character escapes (\f(CW\*(C`E<...>\*(C'\fR) and \f(CW\*(C`S<...>\*(C'\fR are directly mapped to Unicode characters. The special formatting code \f(CW\*(C`X<...>\*(C'\fR is ignored. .SS "Links" .IX Subsection "Links" Some examples of links of different kinds: .PP .PP pod2pandoc .PP \&\*(L"\s-1OPTIONS\*(R"\s0 in pod2pandoc .PP \&\fBperl\fR\|(1) .PP \&\*(L"\s-1ENVIRONMENT\*(R"\s0 in \fBcrontab\fR\|(5) .PP hell itself! .PP Link text can contain formatting codes: .PP the \f(CW\*(C`pod2pandoc\*(C'\fR script .PP \&\*(L"\s-1MAPPING\*(R"\s0 .PP mapping from PoD to Pandoc .ie n .SS "Titles \fImay contain formatting \fP\f(CI""codes""\fP\fI\fP!" .el .SS "Titles \fImay contain formatting \fP\f(CIcodes\fP\fI\fP!" .IX Subsection "Titles may contain formatting codes!" .SS "Lists" .IX Subsection "Lists" .IP "1." 4 Numbered lists are .IP "2." 4 converted to \f(CW\*(C`NumberedList\*(C'\fR and .RS 4 .IP "\(bu" 4 Bulleted lists are .IP "\(bu" 4 converted to .Sp \&\f(CW\*(C`BulletList\*(C'\fR .RE .RS 4 .RE .IP "Definition" 4 .IX Item "Definition" .PD 0 .IP "Lists" 4 .IX Item "Lists" .IP "are" 4 .IX Item "are" .PD \&\fIalso\fR supported. .SS "=over/=back" .IX Subsection "=over/=back" .RS 4 An \f(CW\*(C`=over\*(C'\fR...\f(CW\*(C`=back\*(C'\fR region containing no \f(CW\*(C`=item\*(C'\fR is mapped to \f(CW\*(C`BlockQuote\*(C'\fR. .RE .SS "Verbatim sections" .IX Subsection "Verbatim sections" .Vb 2 \& verbatim sections are mapped \& to code blocks .Ve .SS "Data sections" .IX Subsection "Data sections" Data sections are passed as \f(CW\*(C`RawBlock\*(C'\fR. \f(CW\*(C`HTML\*(C'\fR, \f(CW\*(C`LaTeX\*(C'\fR, \f(CW\*(C`TeX\*(C'\fR, and \f(CW\*(C`tex\*(C'\fR are recognized as alias for \f(CW\*(C`html\*(C'\fR and \f(CW\*(C`tex\*(C'\fR. .PP Option \f(CW\*(C`parse\*(C'\fR can be used to parse data sections with pandoc executable and merge them into the result document. .SH "SEE ALSO" .IX Header "SEE ALSO" This module is based on Pod::Simple (Pod::Simple::SimpleTree). It makes obsolete several specialized \f(CW\*(C`Pod::Simple::...\*(C'\fR modules such as Pod::Simple::HTML, Pod::Simple::XHTML, Pod::Simple::LaTeX, Pod::Simple::RTF Pod::Simple::Text, Pod::Simple::Wiki, Pod::WordML, Pod::Perldoc::ToToc etc.