.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .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. | will give a .\" real vertical bar. \*(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-|\(bv\*(Tr .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" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" 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::XHTML 3" .TH Pod::Simple::XHTML 3 "2009-11-12" "perl v5.8.7" "User Contributed Perl Documentation" .SH "NAME" Pod::Simple::XHTML \-\- format Pod as validating XHTML .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Pod::Simple::XHTML; .Ve .PP .Vb 1 \& my $parser = Pod::Simple::XHTML\->new(); .Ve .PP .Vb 1 \& ... .Ve .PP .Vb 1 \& $parser\->parse_file('path/to/file.pod'); .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. .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 .Sh "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"http://search.cpan.org/perldoc?\*(R". .Sh "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. .Sh "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. .Sh "html_css" .IX Subsection "html_css" .Vb 1 \& $parser\->html_css('path/to/style.css'); .Ve .PP The \s-1URL\s0 or relative path of a \s-1CSS\s0 file to include. This option is not set by default. .Sh "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. .Sh "html_doctype" .IX Subsection "html_doctype" A document type tag for the file. This option is not set by default. .Sh "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). .Sh "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. .Sh "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. .Sh "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. .Sh "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). .SH "SUBCLASSING" .IX Header "SUBCLASSING" If the standard options aren't enough, you may want to subclass Pod::Simple::XHMTL. These are the most likely candidates for methods you'll want to override when subclassing. .Sh "handle_text" .IX Subsection "handle_text" This method handles the body of text within any element: it's the body of a paragraph, or everything between a \*(L"=begin\*(R" tag and the corresponding \*(L"=end\*(R" tag, or the text within an L entity, etc. You would want to override this if you are adding a custom element type that does more than just display formatted text. Perhaps adding a way to generate \&\s-1HTML\s0 tables from an extended version of \s-1POD\s0. .PP So, let's say you want add a custom element called 'foo'. In your subclass's \f(CW\*(C`new\*(C'\fR method, after calling \f(CW\*(C`SUPER::new\*(C'\fR you'd call: .PP .Vb 1 \& $new\->accept_targets_as_text( 'foo' ); .Ve .PP Then override the \f(CW\*(C`start_for\*(C'\fR method in the subclass to check for when \&\*(L"$flags\->{'target'}\*(R" is equal to 'foo' and set a flag that marks that you're in a foo block (maybe \*(L"$self\->{'in_foo'} = 1\*(R"). Then override the \&\f(CW\*(C`handle_text\*(C'\fR method to check for the flag, and pass \f(CW$text\fR to your custom subroutine to construct the \s-1HTML\s0 output for 'foo' elements, something like: .PP .Vb 8 \& sub handle_text { \& my ($self, $text) = @_; \& if ($self\->{'in_foo'}) { \& $self\->{'scratch'} .= build_foo_html($text); \& } else { \& $self\->{'scratch'} .= $text; \& } \& } .Ve .Sh "idify" .IX Subsection "idify" .Vb 2 \& my $id = $pod\->idify($text); \& my $hash = $pod\->idify($text, 1); .Ve .PP This method turns an arbitrary string into a valid \s-1XHTML\s0 \s-1ID\s0 attribute value. The rules enforced, following , are: .IP "\(bu" 4 The id must start with a letter (a\-z or A\-Z) .IP "\(bu" 4 All subsequent characters can be letters, numbers (0\-9), hyphens (\-), underscores (_), colons (:), and periods (.). .IP "\(bu" 4 Each id must be unique within the document. .PP In addition, the returned value will be unique within the context of the Pod::Simple::XHTML object unless a second argument is passed a true value. \s-1ID\s0 attributes should always be unique within a single \s-1XHTML\s0 document, but pass the true value if you are creating not an \s-1ID\s0 but a \s-1URL\s0 hash to point to an \s-1ID\s0 (i.e., if you need to put the \*(L"#foo\*(R" in \f(CW\*(C`foo\*(C'\fR. .SH "SEE ALSO" .IX Header "SEE ALSO" Pod::Simple, Pod::Simple::Methody .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) 2003\-2005 Allison Randal. .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .PP This library is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. .SH "AUTHOR" .IX Header "AUTHOR" Allison Randal