Perl6::Pod reworked
Recently i was reimplement Perl6::Pod to simplify it. First i move to new syntax parser wich build using Regexp::Grammars. And then rewrite export scripts: pod6docbook and pod6xhtml.
During the rewrite of Perl6::Pod using Regexp::Grammars, I experienced a lot of fun. Just look at the text of pod6 grammars [1]. At the end i have the following simple apis for use pod6.
API for use pod6 in app
For convert pod6 to xhtml use:
use Perl6::Pod::Test;
my $html = Perl6::Pod::Test::parse_to_xhtml($pod);
API for hackers
Pod6 Grammars can be inherited. You could debug it step-by-step.
use Regexp::Grammars;
use Perl6::Pod::Grammars;
use Data::Dumper;
my $r = qr{
<extends: Perl6::Pod::Grammar::Blocks>
<debug:step>
\A <File> \Z
}xms;
my $tree ;
if ( $src =~ $r ) {
print Dumper( $/{File} );
}
else {
return undef;
}
How to install Perl6::Pod ?
Under Ubuntu:
sudo add-apt-repository ppa:zahatski/ppa
sudo apt-get install libperl6-pod-perl
or from CPAN [2].
Perl6::Pod hosted on github.com [3]. Reports of bugs are always welcome.
[1]Pod6 grammars.https://github.com/zag/p5-Perl6-Pod/blob/master/lib/Perl6/Pod/Grammars.pm
[2] Implementation of Synopsis26. http://search.cpan.org/dist/Perl6-Pod/
[3] Perl6::Pod on GitHub.https://github.com/zag/p5-Perl6-Pod