15 Mar 2020 09:19:57 UTC
- Distribution: Perl6-Pod
- Module version: 0.74
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (2)
- Testers (260 / 66 / 19)
- KwaliteeBus factor: 0
- % Coverage
- License: perl_5
- Activity24 month
- Download (82.66KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionZAG Zahatski Aliaksandrand 1 contributors
- Zahatski Aliaksandr email@example.com
- SEE ALSO
- COPYRIGHT AND LICENSE
Perl6::Pod - Pod6 implementation
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.
=item FreeBSD =item Linux =item Windows =item MacOS
=defn XML Extensible Markup Language =defn HTML Hyper Text Markup Language
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.
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.
The general syntax is:
=begin BLOCK_TYPE OPTIONAL CONFIG INFO = OPTIONAL EXTRA CONFIG INFO BLOCK CONTENTS =end BLOCK_TYPE
=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 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 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 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
=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.
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
=begin head1 Top Level Heading =end head1
Pod predefines a small number of standard configuration options that can be applied uniformly to built-in block types. These include:
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.
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>.
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>
This option expects a list of formatting codes that are to be recognized within any
V <> 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.
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:
Perl6::Pod::Grammars - Pod6 Grammars
Perl6::Pod::Block - base class for Perldoc blocks
Perl6::Pod::FormattingCode - base class for formatting code
Perl6::Pod::To - base class for output formatters
Zahatski Aliaksandr, <firstname.lastname@example.org>
(Perl6::Pod derived from Perl6::Perldoc by Damian Conway
Ivan Baidakou, <email@example.com>
Copyright (C) 2009-2020 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.