| Pod-POM-View-DocBook documentation | view source | Contained in the Pod-POM-View-DocBook distribution. |
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::View subclass.
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.
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:
new()Constructor for the view object.
Options:
rootname of the root element (default: article)
topsectname of the topmost sectional element (defaults to sect1 if root
is article or chapter if root is book
extractnameif true then if the first =head1 is NAME then its content is
extracted as the title of the root element (default is true)
titlecasingif 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)
preservecaselist 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.
forcecaselist 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.
converthtmlblocksif 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:
view_beginview_forview_head1view_head2view_head3view_head4view_itemview_overview_podview_seq_boldview_seq_codeview_seq_entityview_seq_fileview_seq_italicview_seq_linkview_seq_link_transform_pathview_seq_spaceview_seq_textview_textblockview_verbatimAndrew Ford, <A.Ford@ford-mason.co.uk>
This is version 0.08 of 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.
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:
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Pod-POM-View-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.
| Pod-POM-View-DocBook documentation | view source | Contained in the Pod-POM-View-DocBook distribution. |