NAME
Parrot::Docs::PodToHtml - POD to HTML converter
SYNOPSIS
We subclass Pod::Simple::HTML; see that module for details.
DESCRIPTION
Subclass Pod::Simple::HTML
to override behavior for various Parrot-specific formatting features, and to use our own style.
Instance Methods
new()
-
Extend
Pod::Simple::HTML
method to accept PIR and PASM sections that contain example code, which will be put into a <pre> HTML element. set_parent()
-
Store information about the referring page so we can generate breadcrumbs.
do_beginning()
-
Reimplements the
Pod::Simple::HTML
method to add a header to the start of the document. do_middle()
-
Does the middle of the document. This splits up the long
do_middle()
method inPod:Simple::HTML
, calling the variousprocess_*
methods below. This makes it easier to see where the custom bits of Parrot-specific formatting have to be inserted. process_start_token($token)
-
Process a start token.
process_link_start_token($token)
-
Processes the link start token.
process_code_start_token($token)
-
Processes the code start token. If the code text is the name of a Parrot Perl module, and the current documentation file is not the file for that module, then the documentation file for the module is linked to.
process_file_start_token($token)
-
Processes the file start token. If the text of the next token is a file path and that file contains POD, then a link will be made to that file's documentation file.
process_item_text_or_head_start_token($token)
-
Process the item text or head start token.
process_data_start_token($token)
-
Processes a data start token.
process_for_start_token($token)
-
Processes a for start token.
process_other_start_token($token)
-
Processes a start token not processable by the above methods.
process_end_token($token)
-
Processes an end token.
process_text_token($token)
-
Processes the specified text token. URLs which are not in link tags are linked here for convenience.
do_pod_link($link)
-
This is reimplemented here to avoid a bug in
Pod::Simple::HTML
. resolve_pod_page_link($to, $section)
-
Resolves the POD link. Perl modules are converted to paths.
href_for_perl_module($module)
-
Returns the path to the Perl module's HTML file relative to the current documentation page. Currently only lib/Parrot modules are linkable. Returns
undef
if the current documentation file is the file for the module. do_end()
-
Reimplements the
Pod::Simple::HTML
method to add a footer to the end of the document. html_for_file($file)
-
Returns the HTML for the specified file.
append_html_suffix($path)
-
Returns
$path
with and HTML file suffix added. html_link($href, $text)
-
Returns an HTML anchor with the specified "href".
- href_path($path)
-
Converts the path for use in an "href".
Sequences of backslashes are converted to forward slash.
return_page_title()
-
Return the title in $page_title from do_begining
Functions
HISTORY
In order to avoid modifying Pod:Simple::HTML
, large sections of its code have been copied here, and then refactored and adjusted to enable various bits of Parrot-specific behaviour.
At least, that's what POD2HTML, the original version of this file, said.