Pod::POM::View::DocBook - DocBook XML view of a Pod Object Model
use Pod::POM; use Pod::POM::View::DocBook; $parser = Pod::POM->new; $pom = $parser->parse($file); $parser->default_view('Pod::POM::View::DocBook') $pom->present; # or $view = Pod::Pom::View::DocBook->new(%options); $parser->default_view($view) $pom->present; # or even $pom->present(Pod::Pom::View::DocBook->new(%options));
This module provides a view for Pod::POM that outputs the content as a DocBook XML document. (DocBook is an XML schema particularly suited for computing articles and books - see http://www.docbook.org/ for details.)
Pod::POM
Use the module like any other Pod::POM::View subclass.
Pod::POM::View
If Pod::POM->default_view is passed this modules class name then when the present method is called on the Pod object, this constructor will be called without any options. If you want to override the default options then you have to create a view object and pass it to default_view or on the present method.
Pod::POM->default_view
present
default_view
For example to convert a Pod document to a DocBook chapter document (for inclusion in another document), you might use the following code:
$pom = $parser->parse($file); $view = Pod::Pom::View::DocBook( root => 'chapter' ); print $pom->present($view);
Specifying the root element type determines how the =headN sections map to DocBook sections.
=headN
Apart from the view_* methods (see Pod::POM for details), this module supports the two following methods:
view_*
new()
Constructor for the view object.
Options:
root
name of the root element (default: article)
article
topsect
name of the topmost sectional element (defaults to sect1 if root is article or chapter if root is book
sect1
chapter
book
extractname
if true then if the first =head1 is NAME then its content is extracted as the title of the root element (default is true)
=head1
NAME
titlecasing
if true then title text is converted to initial caps format, i.e. all words are initial capped except for stopwords such as "a", "the", "and", "of", "on", etc. Code sequences within titles are not left alone. (default is enabled)
preservecase
list of words for which case should be preserved in titles. The list may be an array ref or a string of words separated by spaces, commas or vertical bar characters.
forcecase
list of words for which the case in titles should be as specified. The list may be an array ref or a string of words separated by spaces, commas or vertical bar characters.
converthtmlblocks
if true then the content of HTML blocks (indicated with =begin html or =for html) will be parsed and converted to DocBook markup. The contents of blocks marked with docbook are always included. (NOT YET IMPLEMENTED)
=begin html
=for html
docbook
view( $type, $node )
Return the given Pod::POM node as formatted by the View.
The following methods are specializations of the methods in Pod::POM::View:
view_begin
view_for
view_head1
view_head2
view_head3
view_head4
view_item
view_over
view_pod
view_seq_bold
view_seq_code
view_seq_entity
view_seq_file
view_seq_italic
view_seq_link
view_seq_link_transform_path
view_seq_space
view_seq_text
view_textblock
view_verbatim
Andrew Ford, <A.Ford@ford-mason.co.uk>
<A.Ford@ford-mason.co.uk>
This is version 0.08 of Pod::POM::View::DocBook.
Pod::POM::View::DocBook
This is still alpha-level code, many features are not fully implemented.
Please report any bugs or feature requests to bug-pod-pom-view-docbook at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Pod-POM-View-Docbook. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-pod-pom-view-docbook at rt.cpan.org
This module depends on Pod::POM.
You can find documentation for this module with the perldoc command.
perldoc Pod::POM::View::DocBook
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Pod-POM-View-DocBook
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Pod-POM-View-DocBook
CPAN Ratings
http://cpanratings.perl.org/d/Pod-POM-View-DocBook
Search CPAN
http://search.cpan.org/dist/Pod-POM-View-DocBook
perlpodspec
perlpod
Pod::DocBook
Copyright 2009 Andrew Ford and Ford & Mason Ltd, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Pod::POM::View::DocBook, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pod::POM::View::DocBook
CPAN shell
perl -MCPAN -e shell install Pod::POM::View::DocBook
For more information on module installation, please visit the detailed CPAN module installation guide.