Perl6::Pod::Block::code - Verbatim pre-formatted sample source code


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

Index


NAME

Top

Perl6::Pod::Block::code - Verbatim pre-formatted sample source code

SYNOPSIS

Top

     =begin code
      print "Ok";
     =end code

DESCRIPTION

Top

Code blocks are used to specify pre-formatted text (typically source code), which should be rendered without rejustification, without whitespace-squeezing, and without recognizing any inline formatting codes. Code blocks also have an implicit nesting associated with them. Typically these blocks are used to show examples of code, mark-up, or other textual specifications, and are rendered using a fixed-width font.

A code block may be implicitly specified as one or more lines of text, each of which starts with a whitespace character. The block is terminated by a blank line. For example:

    This ordinary paragraph introduces a code block:

            $this = 1 * code('block');
            $which.is_specified(:by<indenting>);




Implicit code blocks may only be used within =pod, =item, =nested, =END, or semantic blocks.

to_xhtml

    =code
    test code

Render to:

    <pre><code>
        test code
    </code></pre>
=cut

sub to_xhtml { my $self = shift; my $parser = shift; my $el = $parser->mk_element('code')->insert_to( $parser->mk_element('pre') ); $el->add_content( $self->_make_elements($parser,@_) ); }

to_docbook

    =code
    test code

Render to:

     <chapter><programlisting><![CDATA[    test code
     ]]></programlisting></chapter>

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.