Perl6::Pod::FormattingCode::A - Replaced by contents of specified macro/object


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

Index


NAME

Top

Perl6::Pod::FormattingCode::A - Replaced by contents of specified macro/object

SYNOPSIS

Top

    =alias PROGNAME    Earl Irradiatem Eventually
    =alias VENDOR      4D Kingdoms
    =alias TERMS_URL   L<http://www.4dk.com/eie>

    The use of A<PROGNAME> is subject to the terms and conditions
    laid out by A<VENDOR>, as specified at A<TERMS_URL>.




DESCRIPTION

Top

A variation on placement codes is the A<> code, which is replaced by the contents of the named alias or object specified within its delimiters. For example:

    =alias PROGNAME    Earl Irradiatem Eventually
    =alias VENDOR      4D Kingdoms
    =alias TERMS_URL   L<http://www.4dk.com/eie>

    The use of A<PROGNAME> is subject to the terms and conditions
    laid out by A<VENDOR>, as specified at A<TERMS_URL>.

Any compile-time Perl 6 object that starts with a sigil is automatically available within an alias placement as well. Unless the object is already a string type, it is converted to a string during document-generation by implicitly calling .perl on it.

So, for example, a document can refer to its own filename (as A<$?FILE>), or to the subroutine inside which the specific Pod is nested (as A<$?ROUTINE>), or to the current class (as A<$?CLASS>). Similarly, the value of any program constants defined with sigils can be easily reproduced in documentation:

    # Actual code...
    constant $GROWTH_RATE of Num where 0..* = 1.6;

    =pod
    =head4 Standard Growth Rate

    The standard growth rate is assumed to be A<$GROWTH_RATE>.

Non-mutating method calls on these objects are also allowed, so a document can reproduce the surrounding subroutine's signature (A<$?ROUTINE.signature>) or the type of a constant (A<$GROWTH_RATE.WHAT>).

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.