NAME
Web::DataService::PodParser - Pod parser module for Web::DataService
SYNOPSIS
This module provides an engine that can parse Pod and generate HTML, for use in generating data service documentation pages. It is used as follows:
my $parser = Web::DataService::PodParser->new();
$parser->parse_pod($doc_string);
my $doc_html = $parser->generate_html({ attributes... });
METHODS
This module provides the following methods:
new
This class method creates a new instance of the parser.
parse_pod
This method takes a single argument, which must be a string containing Pod text. A parse tree is built from this input.
generate_html
This method uses the parse tree built by parse_pod
to create HTML content. This content is returned as a single string, which can then be sent as the body of a response message.
This method takes an attribute hash, which can include any of the following attributes:
css
The value of this attribute should be the URL of a stylesheet, which will be included via an HTML <link> tag. It may be either an absolute or a site-relative URL.
tables
If this attribute has a true value, then Pod lists will be rendered as HTML tables. Otherwise, they will be rendered as HTML definition lists using the tags dl
, dt
, and dd
.
url_generator
The value of this attribute must be a code reference. This is called whenever an embedded link is encountered with one of the prefixes node:
, op:
, or path:
, in order to generate a data service URL corresponding to the remainder of the link (see Web::DataService::Documentation).
AUTHOR
mmcclenn "at" cpan.org
BUGS
Please report any bugs or feature requests to bug-web-dataservice at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Web-DataService. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
COPYRIGHT & LICENSE
Copyright 2014 Michael McClennen, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.