package App::Pod2Epub; ############################################################################### # # App::Pod2Epub - Convert Pod to an ePub eBook. # # # Copyright 2010-2012, John McNamara, jmcnamara@cpan.org # # Documentation after __END__ # use strict; use warnings; use Pod::Simple::XHTML; use vars qw(@ISA $VERSION); @ISA = 'Pod::Simple::XHTML'; $VERSION = '0.05'; ############################################################################### # # new() # # Simple constructor inheriting from Pod::Simple::XHTML. # sub new { my $class = shift; my $self = Pod::Simple::XHTML->new( @_ ); # Don't generate an XHTML index. We will use the ePub TOC instead. $self->index(0); # Add the default XHTML headers. $self->html_header( qq{\n} . qq{\n} . qq{\n} . qq{\n} . qq{\n} . qq{\n} . qq{\n} . qq{\n} . qq{\n} . qq{\n} . qq{\n} ); bless $self, $class; return $self; } 1; __END__ =pod =head1 NAME App::Pod2Epub - Convert Pod to an ePub eBook. =head1 DESCRIPTION This module is used for converting Pod documents to ePub eBooks. The output eBook can be read on a variety of hardware and software eBook readers. Pod is Perl's I format, see L. EPub is an eBook format, see L. This module comes with a L utility that will convert Pod to an ePub eBook. =head1 SYNOPSIS To create a simple filter to convert Pod to an XHTML format suitable for inclusion in an ePub eBook. #!/usr/bin/perl -w use strict; use App::Pod2Epub; my $parser = App::Pod2Epub->new(); if (defined $ARGV[0]) { open IN, $ARGV[0] or die "Couldn't open $ARGV[0]: $!\n"; } else { *IN = *STDIN; } if (defined $ARGV[1]) { open OUT, ">$ARGV[1]" or die "Couldn't open $ARGV[1]: $!\n"; } else { *OUT = *STDOUT; } $parser->output_fh(*OUT); $parser->parse_file(*IN); __END__ To convert Pod to ePub using the installed C utility: pod2epub some_module.pm -o some_module.epub =head1 USING THIS MODULE At the moment this module isn't very useful on its own. It is mainly in existence as a backend for C. It provides a framework to convert Pod documents to an XHTML format suitable for inclusion in an ePub eBook. The ePub creation is handled by L in C. Future versions will move that functionality into this module so that it has a utility of its own. =head1 METHODS =head2 new() The C method is used to create a new C object. =head2 Other methods C inherits all of the methods of its parent modules C and C. See L for more details if you need finer control over the output of this module. =head1 SEE ALSO This module also installs a L command line utility. See C for details. L, a general module for generating EPUB documents. L which this module subclasses. =head1 ACKNOWLEDGEMENTS Thanks to Sean M. Burke and the past and current maintainers for C. Thanks to Oleksandr Tymoshenko for the excellent L. =head1 AUTHOR John McNamara, C =head1 COPYRIGHT & LICENSE Copyright 2010-2012 John McNamara. This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License. See L for more information. =cut