NAME

EBook::MOBI::Pod2Mhtml - Create HTML, flavoured for the MOBI format, out of POD.

This module extends Pod::Parser for parsing capabilities. The module HTML::Entities is used to translate chars to HTML entities.

SYNOPSIS

use EBook::MOBI::Pod2Mhtml;
my $p2h = new EBook::MOBI::Pod2Mhtml;

# $pod_h and $html_out_h are file handles
# or IO::String objects
$p2h->parse_from_filehandle($pod_h, $html_out_h);

# result is now in $html_out_h

METHODS

parse_from_filehandle

This is the method you need to call, if you want this module to be of any help for you. It will take your data in the POD format and return it in special flavoured HTML, which can be then further used for the MOBI format.

Hand over two file handles or Objects of IO::String. The first handle points to your POD, the second waits to receive the result.

# $pod_h and $html_out_h are file handles
# or IO::String objects
$p2h->parse_from_filehandle($pod_h, $html_out_h);

# result is now in $html_out_h

pagemode

Pass any true value to enable 'pagemode'. The effect will be, that before every - but the first - '=head1' there will be a peagebreak inserted. This means: The resulting eBook will start each head1 chapter at a new page.

$p2h->pagemode(1);

Default is to not add any pagebreak.

head0_mode

Pass any true value to enable 'head0_mode'. The effect will be, that you are allowed to use a '=head0' command in your POD.

$p2h->head0_mode(1);

Pod can now look like this:

=head0 Module EBook::MOBI

=head1 NAME

=head1 SYNOPSIS

=head0 Module EBook::MOBI::Pod2Mhtml

=head1 NAME

=head1 SYNOPSIS

=cut

This feature is useful if you want to have the documentation of several modules in Perl in one eBook. You then can add a higher level of titles, so that the TOC does not only contain several NAME and SYNOPSIS entries.

Default is to ignore any '=head0' command.

html_body

Pass any true value to enable 'html_body'. If set, parsed content will be encapsulated in a HTML body tag. You may want this if you parse all data at once. But if there is more to add, you should not use this mode, you then will just get HTML markup which is not encapsulated in a body tag.

$p2h->html_body(1);

Default is to not encapsulate in a body tag.

debug_on

You can just ignore this method if you are not interested in debuging!

Pass a reference to a debug subroutine and enable debug messages.

debug_off

Stop debug messages and erease the reference to the subroutine.

INHERITED INTERNAL METHODS

begin_input

Inherited from Pod::Parser. Gets called when POD-input starts.

command

Inherited from Pod::Parser. Gets called when a command is found.

end_input

Inherited from Pod::Parser. Gets called when POD-input ends.

interior_sequence

Inherited from Pod::Parser. Gets called for inline replacements..

textblock

Inherited from Pod::Parser. Gets called for text sections.

verbatim

Inherited from Pod::Parser. Gets called for code sections..

COPYRIGHT & LICENSE

Copyright 2011 Boris Däppen, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms of Artistic License 2.0.

AUTHOR

Boris Däppen <boris_daeppen@bluewin.ch>