Skip to content

Commit

Permalink
Extracted EPUB formatter from HTML formatter.
Browse files Browse the repository at this point in the history
  • Loading branch information
chromatic committed Mar 24, 2012
1 parent e5d1eb5 commit ba77217
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions lib/Pod/PseudoPod/DOM/Role/EPUB.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package Pod::PseudoPod::DOM::Role::EPUB;
# ABSTRACT: an EPUB XHTML formatter role for PseudoPod DOM trees

use strict;
use warnings;

use Moose::Role;

with 'Pod::PseudoPod::DOM::Role::HTML' =>
{
-excludes => [qw( emit_anchor emit_index )],
};

sub emit_anchor
{
my $self = shift;
return qq|<a id="|
. $self->emit_kids( encode => 'index_anchor' )
. qq|"></a>|;
}

sub emit_index
{
my $self = shift;

my $content = $self->emit_kids( encode => 'index_anchor' );
$content .= $self->id if $self->type eq 'index';

return qq|<a id="$content"></a>|;
}

1;

0 comments on commit ba77217

Please sign in to comment.