The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Pod::POM::View::DocBook - DocBook XML view of a Pod Object Model

SYNOPSIS

    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));

DESCRIPTION

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.

SUBROUTINES/METHODS

Apart from the view_* methods (see Pod::POM for details), this module supports the two following methods:

new()

Constructor for the view object.

Options:

root

name of the root element (default: article)

topsect

name of the topmost sectional element (defaults to sect1 if root is article or chapter if root is 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)

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)

view( $type, $node )

Return the given Pod::POM node as formatted by the View.

INTERNAL METHODS

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_space
view_seq_text
view_textblock
view_verbatim
DEBUG

AUTHOR

Andrew Ford, <A.Ford@ford-mason.co.uk>

VERSION

This is version 0.08 of Pod::POM::View::DocBook.

BUGS AND LIMITATIONS

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.

DEPENDENCIES

This module depends on Pod::POM.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Pod::POM::View::DocBook

You can also look for information at:

SEE ALSO

LICENSE AND COPYRIGHT

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.