App-DocKnot
view release on metacpan or search on metacpan
lib/App/DocKnot/Spin/Thread.pm view on Meta::CPAN
if ($command =~ m{ \A = \w }xms) {
my $variable = substr($command, 1);
if (exists($self->{variable}{$variable})) {
return ($self->{variable}{$variable}, 0, $text);
} else {
$self->_warning("unknown variable \\=$variable");
return (q{}, 0, $text);
}
}
# Special handling for macros. Macros shadow commands of the same name.
if (exists($self->{macro}{$command})) {
my ($args, $definition) = $self->{macro}{$command}->@*;
# Extract the macro arguments, if any were requested.
my @args;
if ($args != 0) {
($text, @args) = $self->_extract($text, $args, 0);
}
# The macro runs in a block context if we're currently in block
lib/App/DocKnot/Spin/Thread.pm view on Meta::CPAN
without decimal places. The next largest unit is used if the value is larger
than 1024. 1024 is used as the scaling factor, not 1000.
=item \version[PACKAGE]
If the C<versions> argument was provided, replaced with the latest version of
PACKAGE.
=back
=head2 Defining Variables and Macros
One of the reasons to use thread instead of HTML is the ability to define new
macros on the fly. If there are constructs that are used more than once in
the page, you can define a macro at the top of that page and then use it
throughout the page.
A variable can be defined with the command:
\=[VARIABLE][VALUE]
( run in 0.317 second using v1.01-cache-2.11-cpan-fd5d4e115d8 )