NAME
EBook::MOBI::Driver::POD - 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 (for users)
The plugin is called like this while using EBook::MOBI
:
use
EBook::MOBI;
my
$book
= EBook::MOBI->new();
my
$POD_in
=
<<END;
=head1 SOME POD
Just an example.
END
$book
->add_content(
data
=>
$POD_in
,
driver
=>
'EBook::MOBI::Driver::POD'
,
driver_options
=> {
pagemode
=> 1,
head0_mode
=> 0 }
);
SYNOPSIS (for developers)
This module is a plugin for EBook::MOBI. You probably don't need to access this module directly, unless you are a developer for EBook::MOBI
.
my
$plugin
= new EBook::MOBI::Driver::POD;
my
$mobi_format
=
$plugin
->parse(
$pod
);
METHODS
parse
This is the method each plugin should provide! It takes the input format as a string and returns MHTML.
OPTIONS (POD plugin specific)
set_options
This method is provided by all plugins. This module supports the following options:
$plugin
->set_options(
pagemode
=> 1,
head0_mode
=> 1);
See description below for more details of the options.
pagemode
Pass any true value to enable pagemode
. The effect will be, that before every - but the first - title on highest level there will be a pagebreak inserted. This means: The resulting ebook will start each h1
chapter at a new page.
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.
Pod can now look like this:
=head0 Module EBook::MOBI
=head1 NAME
=head1 SYNOPSIS
=head0 Module EBook::MOBI::Converter
=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.
SPECIAL SYNTAX FOR IMAGES
POD does not support images. However you can add images with some special markup.
=image /path/to/image.jpg And some description here.
COPYRIGHT & LICENSE
Copyright 2012 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>