NAME
Stencil.pm - Short intro
VERSION
Version 0.1001, released 2015-01-15.
SYNOPSIS
# In a plugin (this is pretty similar to what ToUnparsedText does)
sub render {
my $self = shift;
my @out = ();
STENCIL:
foreach my $stencil ($self->stenciller->all_stencils) {
push @out => join "\n" => $stencil->all_before_input;
push @out => join "\n" => $stencil->all_input;
push @out => join "\n" => $stencil->all_between;
push @out => join "\n" => $stencil->all_output;
push @out => join "\n" => $stencil->all_after_output;
}
return join "\n" => @out;
}
DESCRIPTION
Stenciller reads a special fileformat and provides a way to convert the content into different types of output. For example, it can be used to create documentation and tests from the same source file.
File format
== stencil {} ==
--input--
--end input--
--output--
--end output--
This is the basic layout. A stencil ends when a new stencil block is discovered (there is no set limit to the number of stencils in a file). The (optional) hash is for settings. Each stencil has five parts: before_input
, input
, between
, output
and after_output
. In addition to this there is a header before the first stencil.
:splint classname Stenciller
ATTRIBUTES
:splint attributes
SOURCE
https://github.com/Csson/p5-Stenciller
HOMEPAGE
https://metacpan.org/release/Stenciller
AUTHOR
Erik Carlsson <info@code301.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2015 by Erik Carlsson <info@code301.com>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.