Perl6::Pod::Block::nested - Nesting blocks


Perl6-Pod documentation  | view source Contained in the Perl6-Pod distribution.

Index


NAME

Top

Perl6::Pod::Block::nested - Nesting blocks

SYNOPSIS

Top

    =begin nested
    We are all of us in the gutter,E<NL>
    but some of us are looking at the stars!
        =begin nested
        -- Oscar Wilde
        =end nested
    =end nested

DESCRIPTION

Top

Any block can be nested by specifying a :nested option on it:

    =begin para :nested
        We are all of us in the gutter,E<NL>
        but some of us are looking at the stars!
    =end para

However, qualifying each nested paragraph individually quickly becomes tedious if there are many in a sequence, or if multiple levels of nesting are required:

    =begin para
        We are all of us in the gutter,E<NL>
        but some of us are looking at the stars!
    =end para
    =begin para :nested(2)
            -- Oscar Wilde
    =end para

So Pod provides a =nested block that marks all its contents as being nested:

    =begin nested
    We are all of us in the gutter,E<NL>
    but some of us are looking at the stars!
        =begin nested
        -- Oscar Wilde
        =end nested
    =end nested

Nesting blocks can contain any other kind of block, including implicit paragraph and code blocks. Note that the relative physical indentation of the blocks plays no role in determining their ultimate nesting. The preceding example could equally have been specified:

    =begin nested
    We are all of us in the gutter,E<NL>
    but some of us are looking at the stars!
    =begin nested
    -- Oscar Wilde
    =end nested
    =end nested

FORMATS

Top

to_xhtml

    =nested
    test code

Render to:

    <blockquote>
        test code
    </blockquote>
=cut

sub to_xhtml { my $self = shift; my $parser = shift; my $el = $parser->mk_element('blockquote') ->add_content( $parser->_make_elements(@_) ); return $el; }

to_docbook

    =nested
    test code

Render to:

    <blockquote>
        test code
    </blockquote>
=cut

sub to_docbook { my $self = shift; my $parser = shift; my $el = $parser->mk_element('blockquote') ->add_content( $parser->_make_elements(@_) ); return $el; } 1; __END__

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  | view source Contained in the Perl6-Pod distribution.