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.)
Use the module like any other
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
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.
Apart from the
view_* methods (see Pod::POM for details), this module supports the two following methods:
Constructor for the view object.
name of the root element (default:
name of the topmost sectional element (defaults to
if true then if the first
NAME then its content is extracted as the title of the root element (default is true)
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)
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.
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.
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)
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:
This is version 0.08 of
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.
This module depends on Pod::POM.
You can find documentation for this module with the perldoc command.
You can also look for information at:
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.