Perl6::Pod::Block::format - handle =format block


Perl6-Pod documentation Contained in the Perl6-Pod distribution.

Index


Code Index:

NAME

Top

Perl6::Pod::Block::format - handle =format block

SYNOPSIS

Top

    =for format :xml
    <root><test/></root>

    =for format :xhtml
    <div><br/></div>

    =for format :docbook
    <title>Test chapter</title>
    <para>This is a test para</para>

DESCRIPTION

Top

=format will let you have regions that are not generally interpreted as normal Pod text, but are passed directly to particular formatters. A formatter that can use that format will use the region, otherwise it will be completely ignored.

SEE ALSO

Top

http://zag.ru/perl6-pod/S26.html, Perldoc Pod to HTML converter: http://zag.ru/perl6-pod/, Perl6::Pod::Lib

AUTHOR

Top

Zahatski Aliaksandr, <zag@cpan.org>

COPYRIGHT AND LICENSE

Top


Perl6-Pod documentation Contained in the Perl6-Pod distribution.
package Perl6::Pod::Block::format;

#$Id$

use warnings;
use strict;
use Data::Dumper;
use Test::More;
use Perl6::Pod::Block;
use base 'Perl6::Pod::Block';

sub to_xhtml {
    my $self = shift;
    my $parser = shift;
    exists $self->get_attr->{xhtml} ? shift @_ : '';

}

sub to_xml {
    my $self = shift;
    my $parser = shift;
#    diag Dumper $self->get_attr;
    exists $self->get_attr->{xml} ? shift @_ : '';
}

sub to_docbook {
    my $self = shift;
    my $parser = shift;
    exists $self->get_attr->{docbook} ? shift @_ : '';
}

1;

__END__