| Perl6-Pod documentation | Contained in the Perl6-Pod distribution. |
Perl6::Pod::Block::pod - handle =pod block
=begin pod
para
code
=end pod
=pod - cause the parser to remain in Pod mode
In =pod block:
=pod ordinary paragraphs do not require an explicit marker or delimiters, but there is also an explicit para markerhttp://zag.ru/perl6-pod/S26.html, Perldoc Pod to HTML converter: http://zag.ru/perl6-pod/, Perl6::Pod::Lib
Zahatski Aliaksandr, <zag@cpan.org>
Copyright (C) 2009-2010 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.
| Perl6-Pod documentation | Contained in the Perl6-Pod distribution. |
package Perl6::Pod::Block::pod; #$Id$
use warnings; use strict; use Data::Dumper; use Perl6::Pod::Block; use base 'Perl6::Pod::Block'; sub new { my ( $class, %args ) = @_; my $self = $class->SUPER::new(%args, parent_context=>1); } sub on_para { my $self = shift; my $parser = shift; my $txt = shift; return unless defined $txt; #convert ordinary para to =para # and verbatim text to =code my $rparser = $self->context->{vars}->{root}; #split para to ordinary and verbatim blocks foreach my $txt ( split /^\n/m, $txt ) { my $block_name = ( $txt =~ /^\s+/ ) ? 'code' : 'para'; $rparser->start_block( $block_name, '', 666 ); $rparser->para($txt); $rparser->end_block( $block_name, '', 666 ); } return; } 1; __END__