App-MakeEPUB
view release on metacpan or search on metacpan
examples/initramfs-man/bin/mangle-rman-html.pl view on Meta::CPAN
use 5.010;
use strict;
use warnings;
use Getopt::Long;
use HTML::TreeBuilder;
use Pod::Usage;
binmode(STDIN,':utf8');
my $doctype = 'DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"'
. ' "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"';
my $xmlns = "http://www.w3.org/1999/xhtml";
my %opt;
GetOptions( \%opt,
'title=s',
'help|?', 'manual')
or pod2usage(2);
examples/rfc/bin/finish-htmlrfc.pl view on Meta::CPAN
cleanup_div($tree);
delete_a_name($tree);
delete_br($tree);
delete_span_noprint($tree);
shorten_local_href($tree,qr/#section-\d+/);
shorten_local_href($tree,qr/#appendix-[A-Z]+/);
my $content = $tree->as_HTML();
print STDOUT qq(<?xml version="1.0" encoding="UTF-8"?>\n),
qq(<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"),
qq( "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\n),
$content;
$tree->delete();
}
sub add_id_to_name_in_anchor {
my ($tree) = @_;
my @anchors = $tree->look_down('_tag' => 'a',
examples/rfc/bin/rfc2xhtml.pl view on Meta::CPAN
sub start {
my ($self,$args) = @_;
if ($args) {
$self->_init($args);
}
my $xmlns = $self->{xmlns};
my $title = $self->{title};
my $head = <<"EOHEAD";
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="$xmlns">
<head ><title >$title</title>
<link rel="stylesheet" href="rfc.css" type="text/css" />
</head>
<body>
EOHEAD
print $head;
$self->{state} = 'start';
} # start()
lib/App/MakeEPUB.pm view on Meta::CPAN
level2 => $level2,
spine_order => $spine_order,
} );
Create an App::MakeEPUB object;
The named argument I<epubdir> is the path to the directory containing the
files for the ebook.
The named argument I<spine_order> takes a string containing the names of the
XHTML files in spine order as a comma separated list. If it is missing the
names are sorted by alphabet.
The named argument I<level2> takes a string containing instructions for
HTML::Element->look_down() on how to find the text and id for the level 2
navPoints in the file I<toc.ncf>. It takes a string like
'attr1:val1,attr2:val2,...' and translates it into
HTML::Element->look_down( { attr1 => val1, attr2 => val2, ... } );
The content for the navPoint is taken from the first C<< <a> >> tag inside
( run in 0.643 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )