Current Path : /usr/opt/perl530/man/man3/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //usr/opt/perl530/man/man3/Pod::Simple::HTML.3 |
.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" 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::HTML 3" .TH Pod::Simple::HTML 3 "2019-10-24" "perl v5.30.2" "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::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" .SS "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(\*(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 .SS "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" >}; \& \& my $p = Pod::Simple::HTML\->new; .Ve .PP Include a single javascript source: .PP .Vb 1 \& $p\->html_javascript(\*(Aqhttp://abc.com/a.js\*(Aq); .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(\*(Aq \& <script type="text/javascript" src="http://abc.com/b.js"></script> \& <script type="text/javascript" src="http://abc.com/c.js"></script>\*(Aq); .Ve .PP Include a single css source in the header: .PP .Vb 1 \& $p\->html_css(\*(Aq/style.css\*(Aq); .Ve .PP or insert multiple css sources: .PP .Vb 3 \& $p\->html_css(\*(Aq \& <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">\*(Aq); .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(\*(Aqpath/to/Module/Name.pm\*(Aq); .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 embedded 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 = \*(Aq class="some_class_name\*(Aq; .Ve .SS "html_css" .IX Subsection "html_css" .SS "html_javascript" .IX Subsection "html_javascript" .SS "title_prefix" .IX Subsection "title_prefix" .SS "title_postfix" .IX Subsection "title_postfix" .SS "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(\*(Aq<html><head><title>\*(Aq); .Ve .SS "top_anchor" .IX Subsection "top_anchor" By default Pod::Simple::HTML adds a dummy anchor at the top of the \s-1HTML.\s0 You can change it by calling .PP .Vb 1 \& $p\->top_anchor(\*(Aq<a name="zz" >\*(Aq); .Ve .SS "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... .SS "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 .SS "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(\*(Aq</title>...</head><body id="my_id">\*(Aq); .Ve .SS "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; \& \& use base \*(AqPod::Simple::HTML\*(Aq; \& \& # 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) = @_; \& \& say $link\->tagname; # will be L for links \& say $link\->attr(\*(Aqto\*(Aq); # \& say $link\->attr(\*(Aqtype\*(Aq); # will be \*(Aqpod\*(Aq always \& say $link\->attr(\*(Aqsection\*(Aq); \& \& # Links local to our web site \& if ($link\->tagname eq \*(AqL\*(Aq and $link\->attr(\*(Aqtype\*(Aq) eq \*(Aqpod\*(Aq) { \& my $to = $link\->attr(\*(Aqto\*(Aq); \& if ($to =~ /^Padre::/) { \& $to =~ s{::}{/}g; \& return "/docs/Padre/$to.html"; \& } \& } \& \& # all other links are generated by the parent class \& my $ret = $self\->SUPER::do_pod_link($link); \& return $ret; \& } \& \& 1; .Ve .PP Meanwhile in script.pl: .PP .Vb 1 \& use My::Pod; \& \& my $p = My::Pod\->new; \& \& my $html; \& $p\->output_string(\e$html); \& $p\->parse_file(\*(Aqpath/to/Module/Name.pm\*(Aq); \& open my $out, \*(Aq>\*(Aq, \*(Aqout.html\*(Aq 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, <https://github.com/perl\-pod/pod\-simple/>. Feel free to fork and contribute, or to clone <git://github.com/perl\-pod/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 <http://he.net/> for permission to use its Linux man pages online <http://man.he.net/> site for man page links. .PP Thanks to search.cpan.org <http://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: .IP "\(bu" 4 Allison Randal \f(CW\*(C`allison@perl.org\*(C'\fR .IP "\(bu" 4 Hans Dieter Pearcey \f(CW\*(C`hdp@cpan.org\*(C'\fR .IP "\(bu" 4 David E. Wheeler \f(CW\*(C`dwheeler@cpan.org\*(C'\fR