File: //usr/local/ssl/local/share/man/man3/Pod::Simple::HTML.3
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
.\"
.\" 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::HTML 3"
.TH Pod::Simple::HTML 3 "2011-07-16" "perl v5.8.8" "User Contributed Perl Documentation"
.SH "NAME"
Pod::Simple::HTML \- convert Pod to HTML
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
\& perl -MPod::Simple::HTML -e Pod::Simple::HTML::go thingy.pod
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
This class is for making an \s-1HTML\s0 rendering of a Pod document.
.PP
This is a subclass of Pod::Simple::PullParser and inherits all its
methods (and options).
.PP
Note that if you want to do a batch conversion of a lot of Pod
documents to \s-1HTML\s0, you should see the module Pod::Simple::HTMLBatch.
.SH "CALLING FROM THE COMMAND LINE"
.IX Header "CALLING FROM THE COMMAND LINE"
\&\s-1TODO\s0
.PP
.Vb 1
\& perl -MPod::Simple::HTML -e Pod::Simple::HTML::go Thing.pod Thing.html
.Ve
.SH "CALLING FROM PERL"
.IX Header "CALLING FROM PERL"
.Sh "Minimal code"
.IX Subsection "Minimal code"
.Vb 6
\& use Pod::Simple::HTML;
\& my $p = Pod::Simple::HTML->new;
\& $p->output_string(\emy $html);
\& $p->parse_file('path/to/Module/Name.pm');
\& open my $out, '>', 'out.html' or die "Cannot open 'out.html': $!\en";
\& print $out $html;
.Ve
.Sh "More detailed example"
.IX Subsection "More detailed example"
.Vb 1
\& use Pod::Simple::HTML;
.Ve
.PP
Set the content type:
.PP
.Vb 1
\& $Pod::Simple::HTML::Content_decl = q{<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >};
.Ve
.PP
.Vb 1
\& my $p = Pod::Simple::HTML->new;
.Ve
.PP
Include a single javascript source:
.PP
.Vb 1
\& $p->html_javascript('http://abc.com/a.js');
.Ve
.PP
Or insert multiple javascript source in the header
(or for that matter include anything, thought this is not recommended)
.PP
.Vb 3
\& $p->html_javascript('
\& <script type="text/javascript" src="http://abc.com/b.js"></script>
\& <script type="text/javascript" src="http://abc.com/c.js"></script>');
.Ve
.PP
Include a single css source in the header:
.PP
.Vb 1
\& $p->html_css('/style.css');
.Ve
.PP
or insert multiple css sources:
.PP
.Vb 3
\& $p->html_css('
\& <link rel="stylesheet" type="text/css" title="pod_stylesheet" href="http://remote.server.com/jquery.css">
\& <link rel="stylesheet" type="text/css" title="pod_stylesheet" href="/style.css">');
.Ve
.PP
Tell the parser where should the output go. In this case it will be placed in the \f(CW$html\fR variable:
.PP
.Vb 2
\& my $html;
\& $p->output_string(\e$html);
.Ve
.PP
Parse and process a file with pod in it:
.PP
.Vb 1
\& $p->parse_file('path/to/Module/Name.pm');
.Ve
.SH "METHODS"
.IX Header "METHODS"
\&\s-1TODO\s0
all (most?) accessorized methods
.PP
The following variables need to be set \fBbefore\fR the call to the \->new constructor.
.PP
Set the string that is included before the opening <html> tag:
.PP
.Vb 2
\& $Pod::Simple::HTML::Doctype_decl = qq{<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
\& "http://www.w3.org/TR/html4/loose.dtd">\en};
.Ve
.PP
Set the content-type in the \s-1HTML\s0 head: (defaults to \s-1ISO\-8859\-1\s0)
.PP
.Vb 1
\& $Pod::Simple::HTML::Content_decl = q{<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >};
.Ve
.PP
Set the value that will be ebedded in the opening tags of F, C tags and verbatim text.
F maps to <em>, C maps to <code>, Verbatim text maps to <pre> (Computerese defaults to "")
.PP
.Vb 1
\& $Pod::Simple::HTML::Computerese = ' class="some_class_name';
.Ve
.Sh "html_css"
.IX Subsection "html_css"
.Sh "html_javascript"
.IX Subsection "html_javascript"
.Sh "title_prefix"
.IX Subsection "title_prefix"
.Sh "title_postfix"
.IX Subsection "title_postfix"
.Sh "html_header_before_title"
.IX Subsection "html_header_before_title"
This includes everything before the <title> opening tag including the Document type
and including the opening <title> tag. The following call will set it to be a simple \s-1HTML\s0
file:
.PP
.Vb 1
\& $p->html_header_before_title('<html><head><title>');
.Ve
.Sh "html_h_level"
.IX Subsection "html_h_level"
Normally =head1 will become <h1>, =head2 will become <h2> etc.
Using the html_h_level method will change these levels setting the h level
of =head1 tags:
.PP
.Vb 1
\& $p->html_h_level(3);
.Ve
.PP
Will make sure that =head1 will become <h3> and =head2 will become <h4> etc...
.Sh "index"
.IX Subsection "index"
Set it to some true value if you want to have an index (in reality a table of contents)
to be added at the top of the generated \s-1HTML\s0.
.PP
.Vb 1
\& $p->index(1);
.Ve
.Sh "html_header_after_title"
.IX Subsection "html_header_after_title"
Includes the closing tag of </title> and through the rest of the head
till the opening of the body
.PP
.Vb 1
\& $p->html_header_after_title('</title>...</head><body id="my_id">');
.Ve
.Sh "html_footer"
.IX Subsection "html_footer"
The very end of the document:
.PP
.Vb 1
\& $p->html_footer( qq[\en<!-- end doc -->\en\en</body></html>\en] );
.Ve
.SH "SUBCLASSING"
.IX Header "SUBCLASSING"
Can use any of the methods described above but for further customization
one needs to override some of the methods:
.PP
.Vb 3
\& package My::Pod;
\& use strict;
\& use warnings;
.Ve
.PP
.Vb 1
\& use base 'Pod::Simple::HTML';
.Ve
.PP
.Vb 7
\& # needs to return a URL string such
\& # http://some.other.com/page.html
\& # #anchor_in_the_same_file
\& # /internal/ref.html
\& sub do_pod_link {
\& # My::Pod object and Pod::Simple::PullParserStartToken object
\& my ($self, $link) = @_;
.Ve
.PP
.Vb 4
\& say $link->tagname; # will be L for links
\& say $link->attr('to'); #
\& say $link->attr('type'); # will be 'pod' always
\& say $link->attr('section');
.Ve
.PP
.Vb 8
\& # Links local to our web site
\& if ($link->tagname eq 'L' and $link->attr('type') eq 'pod') {
\& my $to = $link->attr('to');
\& if ($to =~ /^Padre::/) {
\& $to =~ s{::}{/}g;
\& return "/docs/Padre/$to.html";
\& }
\& }
.Ve
.PP
.Vb 4
\& # all other links are generated by the parent class
\& my $ret = $self->SUPER::do_pod_link($link);
\& return $ret;
\& }
.Ve
.PP
.Vb 1
\& 1;
.Ve
.PP
Meanwhile in script.pl:
.PP
.Vb 1
\& use My::Pod;
.Ve
.PP
.Vb 1
\& my $p = My::Pod->new;
.Ve
.PP
.Vb 5
\& my $html;
\& $p->output_string(\e$html);
\& $p->parse_file('path/to/Module/Name.pm');
\& open my $out, '>', 'out.html' or die;
\& print $out $html;
.Ve
.PP
\&\s-1TODO\s0
.PP
maybe override do_beginning do_end
.SH "SEE ALSO"
.IX Header "SEE ALSO"
Pod::Simple, Pod::Simple::HTMLBatch
.PP
\&\s-1TODO:\s0 a corpus of sample Pod input and \s-1HTML\s0 output? Or common
idioms?
.SH "SUPPORT"
.IX Header "SUPPORT"
Questions or discussion about \s-1POD\s0 and Pod::Simple should be sent to the
pod\-people@perl.org mail list. Send an empty email to
pod\-people\-subscribe@perl.org to subscribe.
.PP
This module is managed in an open GitHub repository,
<http://github.com/theory/pod\-simple/>. Feel free to fork and contribute, or
to clone <git://github.com/theory/pod\-simple.git> and send patches!
.PP
Patches against Pod::Simple are welcome. Please send bug reports to
<bug\-pod\-simple@rt.cpan.org>.
.SH "COPYRIGHT AND DISCLAIMERS"
.IX Header "COPYRIGHT AND DISCLAIMERS"
Copyright (c) 2002\-2004 Sean M. Burke.
.PP
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
.PP
This program 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 "ACKNOWLEDGEMENTS"
.IX Header "ACKNOWLEDGEMENTS"
Thanks to Hurricane Electric for permission to use its
Linux man pages online site for man page links.
.PP
Thanks to search.cpan.org for permission to use the
site for Perl module links.
.SH "AUTHOR"
.IX Header "AUTHOR"
Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
But don't bother him, he's retired.
.PP
Pod::Simple is maintained by:
.ie n .IP "* Allison Randal ""allison@perl.org""" 4
.el .IP "* Allison Randal \f(CWallison@perl.org\fR" 4
.IX Item "Allison Randal allison@perl.org"
.PD 0
.ie n .IP "* Hans Dieter Pearcey ""hdp@cpan.org""" 4
.el .IP "* Hans Dieter Pearcey \f(CWhdp@cpan.org\fR" 4
.IX Item "Hans Dieter Pearcey hdp@cpan.org"
.ie n .IP "* David E. Wheeler ""dwheeler@cpan.org""" 4
.el .IP "* David E. Wheeler \f(CWdwheeler@cpan.org\fR" 4
.IX Item "David E. Wheeler dwheeler@cpan.org"