.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) .\" .\" 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 .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . 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 2024-09-01 "perl v5.40.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 XHTML validating HTML. .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 POD is properly encoded (using the \f(CW\*(C`=encoding\*(C'\fR command), you can prevent high-bit characters from being encoded as HTML entities and declare the output character set as UTF\-8 before parsing, like so: .PP .Vb 3 \& $psx\->html_charset(\*(AqUTF\-8\*(Aq); \&use warnings; \& $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 HTML 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 "Foo%3a%3aBar". The default value is "https://metacpan.org/pod/". .SS perldoc_url_postfix .IX Subsection "perldoc_url_postfix" What to put after "Foo%3a%3aBar" in the URL. 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 "1/crontab". The default value is "http://man.he.net/man". .SS man_url_postfix .IX Subsection "man_url_postfix" What to put after "1/crontab" in the URL. 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 URL or relative path of a CSS file to include. This option is not set by default. .SS html_javascript .IX Subsection "html_javascript" The URL 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 "ISO\-8859\-1". .SS html_header_tags .IX Subsection "html_header_tags" Additional arbitrary HTML 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 CSS 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 HTML 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 HTML "Hn" element to which a Pod "head1" 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 HTML 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 CSS 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 HTML headers and footers or are integrating converted POD pages in a larger website. .PP If you want no headers or footers output in the HTML, 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`