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.
The plugin is called like this while using EBook::MOBI:
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 } );
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.
use EBook::MOBI::Driver::POD; my $plugin = new EBook::MOBI::Driver::POD; my $mobi_format = $plugin->parse($pod);
This is the method each plugin should provide! It takes the input format as a string and returns MHTML.
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.
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.
pagemode
h1
Default is to not add any pagebreak.
Pass any true value to enable head0_mode. The effect will be, that you are allowed to use a =head0 command in your POD.
head0_mode
=head0
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.
POD does not support images. However you can add images with some special markup.
=image /path/to/image.jpg And some description here.
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.
Boris Däppen <boris_daeppen@bluewin.ch>
To install EBook::MOBI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm EBook::MOBI
CPAN shell
perl -MCPAN -e shell install EBook::MOBI
For more information on module installation, please visit the detailed CPAN module installation guide.