NAME
Template::Plugin::Filter::PlantUML - A template toolkit plugin filter for encoding and processing PlantUML Diagrams using a PlantUML Server.
VERSION
Version 0.02
SYNOPSIS
To use this plugin, you have to make sure that the Template Toolkit knows about its namespace.
my $tt2 = Template->new({
PLUGIN_BASE => 'Template::Plugin::Filter',
});
# or
my $tt2 = Template->new({
PLUGINS => {
PlantUML => 'Template::Plugin::Filter::PlantUML',
},
});
Then you USE
your plugin in a template file as follows.
[% USE 'http://www.plantuml.com/plantuml' 'svg' -%]
[% url = FILTER plantuml %]
Bob -> Alice : hello
[% END %]
<img src="[% url %]"/>
Finally process your template.
$tt2->process('foo.tt2') || die $tt2->error();
Result would be:
<img src="http://www.plantuml.com/plantuml/svg/~169NZKb1moazIqBLJSCp9J4vLi5B8ICt9oUS204a_1dy0"/>
EXAMPLE
DESCRIPTION
This is a trivial Template::Toolkit plugin filter to allow any template writer to embed PlantUML Diagram Syntax in Templates and have them encoded and processed via any PlantUML Server in any supported formats.
It uses WWW:PlantUML
remote client under the hood.
SUBROUTINES/METHODS
init
defines init() method.
filter
defines filter() method.
AUTHOR
Rangana Sudesha Withanage, <rwi at cpan.org>
BUGS
Please report any bugs or feature requests to bug-template-plugin-filter-plantuml at rt.cpan.org
, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Template-Plugin-Filter-PlantUML. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Template::Plugin::Filter::PlantUML
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
https://rt.cpan.org/NoAuth/Bugs.html?Dist=Template-Plugin-Filter-PlantUML
GitHub Repository
https://github.com/ranwitter/perl5-Template-Plugin-Filter-PlantUML
CPAN Ratings
https://cpanratings.perl.org/d/Template-Plugin-Filter-PlantUML
Search CPAN
https://metacpan.org/release/Template-Plugin-Filter-PlantUML
ACKNOWLEDGEMENTS
Many thanks to Andy Wardley http://wardley.org for his awesome Template::Plugin::Filter
LICENSE AND COPYRIGHT
This software is copyright (c) 2019 by Rangana Sudesha Withanage.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.