Dist::Zilla Generic Model

Sorry still on the all POD diet here at the Dist-pen today

In my last post I had a look at custom [Region] section and how that section lets you define your own custom tags you can use in you POD. Today I am looking at one of the often used sections and one of the more simple ones the [Generic] section.

If you look at the [@Default] template you will see no less than fours calls to this plug-in

...
[Generic / SYNOPSIS]
[Generic / DESCRIPTION]
[Generic / OVERVIEW]
[Collect / ATTRIBUTES]
...
so you will encounter quite often while looking at others templates. Like all the other plug-ins I can move them about in the template and that is how they will come out in the POD.

One uses this plug in to place in you POD any section of POD that begins with a '=head1' and matches the 'header' attribute you pass in. In the case where you POD does not match one of the '=head1' Pod::Weaver just ignores it.

In my present POD I happen to have;

=head1 Datatbase::Accessor is not an ORM

=head1 Table Of Contents
So two '=head1' that I could use with this plug-in. Now for some odd reason I want my TOC above my version section so I simply add this

[Region  / manual_header]
++[Generic / Table Of Contents]
[Version]
to my 'weaver.ini' file and give dzil the old clean and build and I get this

…
=head1 Table Of Contents

=head1 Version.


in my POD my TOC above version even though it is at the bottom of the real document. So neat and sweet.

Like the [Region] plug-in it has both a 'required' and a 'header' attribute and the work in the same manner. 'required' when set to 1 will cause the Pod::Weaver to error if it is missing and 'header' is just the long hand way to enter the header attribute.

As you see above in the [@Default] template you can use as many of these plug-ins as you want as long as they all have unique names.

So just a quick post for today.

aurora.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