#=============================================================================== # # DESCRIPTION: Replaced by contents of specified macro/object # # AUTHOR: Aliaksandr P. Zahatski, #=============================================================================== package Perl6::Pod::FormattingCode::A; =pod =head1 NAME Perl6::Pod::FormattingCode::A - Replaced by contents of specified macro/object =head1 SYNOPSIS =alias PROGNAME Earl Irradiatem Eventually =alias VENDOR 4D Kingdoms =alias TERMS_URL L The use of A is subject to the terms and conditions laid out by A, as specified at A. =head1 DESCRIPTION A variation on placement codes is the CE> 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 The use of A is subject to the terms and conditions laid out by A, as specified at A. 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 C<.perl> on it. So, for example, a document can refer to its own filename (as C$?FILEE>), or to the subroutine inside which the specific Pod is nested (as C$?ROUTINEE>), or to the current class (as C$?CLASSE>). 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 (C$?ROUTINE.signatureE>) or the type of a constant (C$GROWTH_RATE.WHATE>). =cut use warnings; use strict; use Data::Dumper; use Perl6::Pod::FormattingCode; use Perl6::Pod::Utl; use base 'Perl6::Pod::FormattingCode'; our $VERSION = '0.01'; sub new { my $class = shift; my $self = $class->SUPER::new(@_); my $alias_value = $self->context->{_alias}->{$self->{content}->[0]}; if (my $tree = Perl6::Pod::Utl::parse_para($alias_value) ) { $self->{content} = $tree; } return $self; } sub to_xhtml { my $self = shift; my $to = shift; $to->visit_childs($self); } sub to_docbook { my $self = shift; my $to = shift; $to->visit_childs($self); } sub to_latex { my $self = shift; my $to = shift; $to->visit_childs($self); } 1; __END__ =head1 SEE ALSO L, Perldoc Pod to HTML converter: L, Perl6::Pod::Lib =head1 AUTHOR Zahatski Aliaksandr, =head1 COPYRIGHT AND LICENSE Copyright (C) 2009-2015 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. =cut