package Perl6::Pod::To::XHTML; =pod =head1 NAME Perl6::Pod::To::XHTML - XHTML formater =head1 SYNOPSIS my $p = new Perl6::Pod::To::XHTML:: add root tag my $p = new Perl6::Pod::To::XHTML:: doctype => 'html', =head1 DESCRIPTION Process pod to xhtml Sample: =begin pod =NAME Test chapter =para This is a test para =end pod Run converter: pod6xhtml test.pod > test.xhtml Result xml: Test chapter This is a test para =cut use strict; use warnings; use Perl6::Pod::To; use base 'Perl6::Pod::To'; use Perl6::Pod::Utl; use Data::Dumper; sub start_write { my $self = shift; my $w = $self->writer; $self->w->raw_print( '<' . $self->{doctype} . ' xmlns="">') if $self->{doctype}; } sub end_write { my $self = shift; #export N<> notes my $notes = $self->{CODE_N}||[]; if (my $count = scalar(@$notes)) { my $w = $self->w; $w->raw('
') ->raw('


'); my $nid = 1; foreach my $n (@$notes) { $w->raw(qq!

${nid}. !); $self->visit_childs($n); $w->raw('

'); $nid++; } $self->w->raw('
'); } $self->w->raw_print( '{doctype} . '>' ) if $self->{doctype}; } 1; __END__ =head1 SEE ALSO L =head1 AUTHOR Zahatski Aliaksandr, =head1 COPYRIGHT AND LICENSE Copyright (C) 2009 by Zahatski Aliaksandr This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available. =cut