.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" 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 .\" ======================================================================== .\" .IX Title "Pod::Simple::XHTML 3perl" .TH Pod::Simple::XHTML 3perl "2023-11-25" "perl v5.36.0" "Perl Programmers Reference Guide" .\" 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::XHTML \-\- format Pod as validating XHTML .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Pod::Simple::XHTML; \& \& my $parser = Pod::Simple::XHTML\->new(); \& \& ... \& \& $parser\->parse_file(\*(Aqpath/to/file.pod\*(Aq); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This class is a formatter that takes Pod and renders it as \s-1XHTML\s0 validating \s-1HTML.\s0 .PP This is a subclass of Pod::Simple::Methody and inherits all its methods. The implementation is entirely different than Pod::Simple::HTML, but it largely preserves the same interface. .SS "Minimal code" .IX Subsection "Minimal code" .Vb 6 \& use Pod::Simple::XHTML; \& my $psx = Pod::Simple::XHTML\->new; \& $psx\->output_string(\emy $html); \& $psx\->parse_file(\*(Aqpath/to/Module/Name.pm\*(Aq); \& open my $out, \*(Aq>\*(Aq, \*(Aqout.html\*(Aq or die "Cannot open \*(Aqout.html\*(Aq: $!\en"; \& print $out $html; .Ve .PP You can also control the character encoding and entities. For example, if you're sure that the \s-1POD\s0 is properly encoded (using the \f(CW\*(C`=encoding\*(C'\fR command), you can prevent high-bit characters from being encoded as \s-1HTML\s0 entities and declare the output character set as \s-1UTF\-8\s0 before parsing, like so: .PP .Vb 2 \& $psx\->html_charset(\*(AqUTF\-8\*(Aq); \& $psx\->html_encode_chars(q{&<>\*(Aq"}); .Ve .SH "METHODS" .IX Header "METHODS" Pod::Simple::XHTML offers a number of methods that modify the format of the \s-1HTML\s0 output. Call these after creating the parser object, but before the call to \f(CW\*(C`parse_file\*(C'\fR: .PP .Vb 3 \& my $parser = Pod::PseudoPod::HTML\->new(); \& $parser\->set_optional_param("value"); \& $parser\->parse_file($file); .Ve .SS "perldoc_url_prefix" .IX Subsection "perldoc_url_prefix" In turning Foo::Bar into http://whatever/Foo%3a%3aBar, what to put before the \*(L"Foo%3a%3aBar\*(R". The default value is \&\*(L"https://metacpan.org/pod/\*(R". .SS "perldoc_url_postfix" .IX Subsection "perldoc_url_postfix" What to put after \*(L"Foo%3a%3aBar\*(R" in the \s-1URL.\s0 This option is not set by default. .SS "man_url_prefix" .IX Subsection "man_url_prefix" In turning \f(CWcrontab(5)\fR into http://whatever/man/1/crontab, what to put before the \*(L"1/crontab\*(R". The default value is \&\*(L"http://man.he.net/man\*(R". .SS "man_url_postfix" .IX Subsection "man_url_postfix" What to put after \*(L"1/crontab\*(R" in the \s-1URL.\s0 This option is not set by default. .SS "title_prefix, title_postfix" .IX Subsection "title_prefix, title_postfix" What to put before and after the title in the head. The values should already be &\-escaped. .SS "html_css" .IX Subsection "html_css" .Vb 1 \& $parser\->html_css(\*(Aqpath/to/style.css\*(Aq); .Ve .PP The \s-1URL\s0 or relative path of a \s-1CSS\s0 file to include. This option is not set by default. .SS "html_javascript" .IX Subsection "html_javascript" The \s-1URL\s0 or relative path of a JavaScript file to pull in. This option is not set by default. .SS "html_doctype" .IX Subsection "html_doctype" A document type tag for the file. This option is not set by default. .SS "html_charset" .IX Subsection "html_charset" The character set to declare in the Content-Type meta tag created by default for \f(CW\*(C`html_header_tags\*(C'\fR. Note that this option will be ignored if the value of \&\f(CW\*(C`html_header_tags\*(C'\fR is changed. Defaults to \*(L"\s-1ISO\-8859\-1\*(R".\s0 .SS "html_header_tags" .IX Subsection "html_header_tags" Additional arbitrary \s-1HTML\s0 tags for the header of the document. The default value is just a content type header tag: .PP .Vb 1 \& .Ve .PP Add additional meta tags here, or blocks of inline \s-1CSS\s0 or JavaScript (wrapped in the appropriate tags). .PP \fIhtml_encode_chars\fR .IX Subsection "html_encode_chars" .PP A string containing all characters that should be encoded as \s-1HTML\s0 entities, specified using the regular expression character class syntax (what you find within brackets in regular expressions). This value will be passed as the second argument to the \f(CW\*(C`encode_entities\*(C'\fR function of HTML::Entities. If HTML::Entities is not installed, then any characters other than \f(CW\*(C`&<\*(C'\fR"'> will be encoded numerically. .SS "html_h_level" .IX Subsection "html_h_level" This is the level of \s-1HTML\s0 \*(L"Hn\*(R" element to which a Pod \*(L"head1\*(R" corresponds. For example, if \f(CW\*(C`html_h_level\*(C'\fR is set to 2, a head1 will produce an H2, a head2 will produce an H3, and so on. .SS "default_title" .IX Subsection "default_title" Set a default title for the page if no title can be determined from the content. The value of this string should already be &\-escaped. .SS "force_title" .IX Subsection "force_title" Force a title for the page (don't try to determine it from the content). The value of this string should already be &\-escaped. .SS "html_header, html_footer" .IX Subsection "html_header, html_footer" Set the \s-1HTML\s0 output at the beginning and end of each file. The default header includes a title, a doctype tag (if \f(CW\*(C`html_doctype\*(C'\fR is set), a content tag (customized by \f(CW\*(C`html_header_tags\*(C'\fR), a tag for a \s-1CSS\s0 file (if \f(CW\*(C`html_css\*(C'\fR is set), and a tag for a Javascript file (if \&\f(CW\*(C`html_javascript\*(C'\fR is set). The default footer simply closes the \f(CW\*(C`html\*(C'\fR and \f(CW\*(C`body\*(C'\fR tags. .PP The options listed above customize parts of the default header, but setting \f(CW\*(C`html_header\*(C'\fR or \f(CW\*(C`html_footer\*(C'\fR completely overrides the built-in header or footer. These may be useful if you want to use template tags instead of literal \s-1HTML\s0 headers and footers or are integrating converted \s-1POD\s0 pages in a larger website. .PP If you want no headers or footers output in the \s-1HTML,\s0 set these options to the empty string. .SS "index" .IX Subsection "index" Whether to add a table-of-contents at the top of each page (called an index for the sake of tradition). .SS "anchor_items" .IX Subsection "anchor_items" Whether to anchor every definition \f(CW\*(C`=item\*(C'\fR directive. This needs to be enabled if you want to be able to link to specific \f(CW\*(C`=item\*(C'\fR directives, which are output as \f(CW\*(C`