DocSet::Doc::POD2HTMLPS - POD source to PS (intermediate HTML) target converter
DocSet::Doc::POD2HTMLPS
Implements an DocSet::Doc sub-class which converts a source document in POD, into an output document in PS (intermediate in HTML).
DocSet::Doc
For the rest of the super class methods see DocSet::Doc.
convert
documents using this class are rendered via DocSet::Doc::POD2HTML::View::HTMLPS, which is a subclass of Pod::POM::View::HTML.
DocSet::Doc::POD2HTML::View::HTMLPS
Pod::POM::View::HTML
Since we want the final PDF document which potentially includes many chapters in it to look more as a book and have a nice Table of Contents, we need to change the default structure of =head1 specs, so the =head1 NAME becomes a title of the chapter and removed from the POD source, therefore we need to bump up all the remaining =headX headers by one. i.e. =head1 is rendered as =head2, =head3 as =head3, etc. Therefore we override the super class's methods view_head{1-4}. In addition we put <a name> anchors next to the headers so the PDF document can be hyperlinked if the reader supports this feature.
=head1
=head1 NAME
=headX
=head2
=head3
view_head{1-4}
view_seq_file() is overriden too. Here we search for the file relative to the location of the document and if we find it we include its contents since the PDFs are created for making dead tree copies and therefore linking is not an option. Notice that it's OK to say F</etc/passwd> since it won't be found unless you actually put it under the current documents path or put the source document in the / path.
view_verbatim() is overriden: renders the <pre>...</pre> html, but defines a CSS class pre-section so the look-n-feel can be adjusted. in addition it splits text into 40 lines chunks. This solves two problems:
pre-section
html2ps tries to fit the whole <pre>...</pre> in a single page ending up using a very small unreadable font when the text is long.
html2ps
ps2pdf fails to convert ps to pdf if the former includes <pre>...</pre>, longer than 40 lines in one chunk.
ps2pdf
The following rendering methods: anchor() and view_seq_link_transform_path() are defined in the DocSet::Doc::Common class and documented there.
DocSet::Doc::Common
Stas Bekman <stas (at) stason.org>
To install DocSet, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DocSet
CPAN shell
perl -MCPAN -e shell install DocSet
For more information on module installation, please visit the detailed CPAN module installation guide.