NAME

Perl6::Pod - use Perl6's pod in perl5 programms

SYNOPSIS

use Perl6::Pod;

=comment
Some text

=head1 Head title
=para
Some text of para

Delimited style, paragraph style, or abbreviated style of blocks

=begin para :formatted<B I>
Perl is a stable, cross platform programming language. 
=end para

=for para :formatted<B I>
Perl is a stable, cross platform programming language. 

=para
Perl is a stable, cross platform programming language. 

Unordered lists

=item FreeBSD
=item Linux
=item Windows
=item MacOS

Definition lists

=defn XML
Extensible Markup Language
=defn HTML
Hyper Text Markup Language

DESCRIPTION

Pod is an evolution of Perl 5's Plain Old Documentation (POD) markup. Compared to Perl 5 POD, Perldoc's Pod dialect is much more uniform, somewhat more compact, and considerably more expressive. The Pod dialect also differs in that it is a purely descriptive mark-up notation, with no presentational components.

General syntactic structure

Pod documents are specified using directives, which are used to declare configuration information and to delimit blocks of textual content. Every directive starts with an equals sign (=) in the first column.

The content of a document is specified within one or more blocks. Every Pod block may be declared in any of three equivalent forms: delimited style, paragraph style, or abbreviated style.

Delimited blocks

The general syntax is:

=begin BLOCK_TYPE  OPTIONAL CONFIG INFO
=                  OPTIONAL EXTRA CONFIG INFO
BLOCK CONTENTS
=end BLOCK_TYPE

For example:

=begin table  :caption<Table of Contents>
    Constants           1
    Variables           10
    Subroutines         33
    Everything else     57
=end table

=begin Name  :required
=            :width(50)
The applicant's full name
=end Name

=begin Contact  :optional
The applicant's contact details
=end Contact

Paragraph blocks

Paragraph blocks are introduced by a =for marker and terminated by the next Pod directive or the first blank line (which is not considered to be part of the block's contents). The =for marker is followed by the name of the block and optional configuration information. The general syntax is:

=for BLOCK_TYPE  OPTIONAL CONFIG INFO
=                OPTIONAL EXTRA CONFIG INFO
BLOCK DATA

For example:

=for table  :caption<Table of Contents>
    Constants           1
    Variables           10
    Subroutines         33
    Everything else     57

=for Name  :required
=          :width(50)
The applicant's full name

=for Contact  :optional
The applicant's contact details

Abbreviated blocks

Abbreviated blocks are introduced by an '=' sign in the first column, which is followed immediately by the typename of the block. The rest of the line is treated as block data, rather than as configuration. The content terminates at the next Pod directive or the first blank line (which is not part of the block data). The general syntax is:

=BLOCK_TYPE  BLOCK DATA
MORE BLOCK DATA

For example:

=table
    Constants           1
    Variables           10
    Subroutines         33
    Everything else     57

=Name     The applicant's full name
=Contact  The applicant's contact details

Note that abbreviated blocks cannot specify configuration information. If configuration is required, use a =for or =begin/=end instead.

Block equivalence

The three block specifications (delimited, paragraph, and abbreviated) are treated identically by the underlying documentation model, so you can use whichever form is most convenient for a particular documentation task. In the descriptions that follow, the abbreviated form will generally be used, but should be read as standing for all three forms equally.

For example, although Headings shows only:

=head1 Top Level Heading

this automatically implies that you could also write that block as:

=for head1
Top Level Heading

or:

=begin head1
Top Level Heading
=end head1

Standard configuration options

Pod predefines a small number of standard configuration options that can be applied uniformly to built-in block types. These include:

:numbered

This option specifies that the block is to be numbered. The most common use of this option is to create numbered headings and ordered lists, but it can be applied to any block.

It is up to individual renderers to decide how to display any numbering associated with other types of blocks.

:term

This option specifies that a list item is the definition of a term. See Definition lists.

:formatted

This option specifies that the contents of the block should be treated as if they had one or more formatting codes placed around them.

For example, instead of:

=for comment
    The next para is both important and fundamental,
    so doubly emphasize it...

=begin para
B<I<
Warning: Do not immerse in water. Do not expose to bright light.
Do not feed after midnight.
>>
=end para

you can just write:

=begin para :formatted<B I>
Warning: Do not immerse in water. Do not expose to bright light.
Do not feed after midnight.
=end para

The internal representations of these two versions are exactly the same, except that the second one retains the :formatted option information as part of the resulting block object.

Like all formatting codes, codes applied via a :formatted are inherently cumulative. For example, if the block itself is already inside a formatting code, that formatting code will still apply, in addition to the extra "basis" and "important" formatting specified by :formatted<B I>.

:like

This option specifies that a block or config has the same formatting properties as the type named by its value. This is useful for creating related configurations. For example:

=config head2  :like<head1> :formatted<I>

:allow

This option expects a list of formatting codes that are to be recognized within any codes that appear in (or are implicitly applied to) the current block. The option is most often used on =code blocks to allow mark-up within those otherwise verbatim blocks, though it can be used in any block that contains verbatim text. See Formatting within code blocks.

Blocks

Formatting codes

Diffs to SYNOPSIS 26 by 25 Apr 2007 edition

delete "Code" type from perl6-ish option pairs due security and portability(compatibilitty) issues
use :allow attribute for any block or formatting codes

Perl6::Pod - in general, a set of classes, scripts and modules for maintance Perl6's pod documentation using perl5.

The suite contain the following classes:

DOCUMENTING !DOCUMENTING !DOCUMENTING !DOCUMENTING !DOCUMENTING !

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>

(Perl6::Pod derived from Perl6::Perldoc by Damian Conway <DCONWAY@CPAN.org>)

COPYRIGHT AND LICENSE

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.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 200:

Deleting unknown formatting code V<>