Zahatski Aliaksandr > Perl6-Pod-0.60 > Perl6::Pod::Block::code

Download:
Perl6-Pod-0.60.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  1
View/Report Bugs
Source  

NAME ^

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

SYNOPSIS ^

     =begin code
      print "Ok";
     =end code

DESCRIPTION ^

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>

to_docbook

    =code
    test code

Render to:

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

SEE ALSO ^

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

AUTHOR ^

Zahatski Aliaksandr, <zag@cpan.org>

COPYRIGHT AND LICENSE ^

Copyright (C) 2009-2012 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.

syntax highlighting: