Dist::Zilla Templated

Well it 'T' day here at the Dist-Pen

Getting near the end of the section plug-ins I am looking at the [Template] plug-in. This one is much like the [GenerateSection] plug-in I had a look at in this post.

To use this plug-in to generate the same section I created in the other post above

=head3 Database::Accessor Tutorial 
Welcome to  Page xxxxx
I will first have to create that in a file with the {{}} in the right spots. So I created the file 'header.section' with this content;

Welcome to Page {{$name}} of the {{ $main_module_name }} tutorial.
Which is a little different than the other post as I finally figured out how to get the main module name in there. Once I installed the plug-in I now had to set up the 'weaver.ini' file like this

[GenerateSection]
head=3
title={{$dist}}} Tutorial
text= Welcome to Page {{$name}
++[Template / Database::Accssor Tutorial]
++template = header.section
and then I give it a good old clean and build I get

=head1 Database::Accssor Tutorial
Welcome to Page Database-Accessor of the Database::Accessor tutorial.
So getting what I expect with similar output to the results in the other post. Still need to figure out how to get the page name in there for actually tutorial pages but that is another story.

So that is the post-ette for today.

f04b899f4e98a372632e7864a4ecd9ca.jpg

Leave a comment

About byterock

user-pic Long time Perl guy, a few CPAN mods allot of work on DBD::Oracle and a few YAPC presentations