Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

epub creation #124

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion build/tools/build_epub.pl
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ sub add_cover
. qq[<style type="text/css"> img { max-width: 100%; }</style>\n]
. qq[</head>\n]
. qq[<body>\n]
. qq[ <img alt="Modern Perl" src="../images/cover.png" />\n]
. qq[<p><img alt="Modern Perl" src="../images/cover.png" /></p>\n]
. qq[</body>\n]
. qq[</html>\n\n];

Expand Down Expand Up @@ -318,6 +318,9 @@ sub start_Document
$self->emit('nowrap');
}

# Override Pod::PseudoPod::HTML open Z<> generated <a> tags.
sub start_Z { $_[0]{'scratch'} .= '<a id="' }

# Override Pod::PseudoPod::HTML close Z<> generated <a> tags.
sub end_Z { $_[0]{'scratch'} .= '"/>' }

Expand Down Expand Up @@ -356,4 +359,20 @@ sub _end_head
push @{$_[0]{'to_index'}}, [$h, $id, $text, $chapter];
}

# Override Pod::PseudoPod::HTML U<> to prevent deprecated <font> tag.
sub start_U { $_[0]{'scratch'} .= '<span class="url">' if $_[0]{'css_tags'} }
sub end_U { $_[0]{'scratch'} .= '</span>' if $_[0]{'css_tags'} }

# Override Pod::PseudoPod::HTML N<> to prevent deprecated <font> tag.
sub start_N {
my ($self) = @_;
$self->{'scratch'} .= '<span class="footnote">' if ($self->{'css_tags'});
$self->{'scratch'} .= ' (footnote: ';
}
sub end_N {
my ($self) = @_;
$self->{'scratch'} .= ')';
$self->{'scratch'} .= '</span>' if $self->{'css_tags'};
}

__END__