Dist::Zilla Takes it in the Name

Another Pod post here in the Dist-pen.

In my last post one saw how you can change the order of the 'sections' of your POD by simply not using the '@Default' template and using you own custom template. You also saw haw you can use other peoples templates by simply installing them and the swapping them out for the [@Default] template.

Today I am going to have a closer look at the [Name] section.

This is one of the more simplistic section templates, it only produces the following;

=head1 NAME

Database::Accessor::Manual - What is Database::Accessor, and how do I use it?
It will look in your POD fro the following comments
  • # ABSTRACT:
  • # PODNAME:
So to produce the above my original Pod is;

# PODNAME: Database::Accessor::Manual
# ABSTRACT: What is Database::Accessor, and how do I use it?

=pod
Now if there is no '# PODNAME' and there is a package declaration it will use that. If it can't find either it will error the the 'Bobby_Tables.pl' message we saw in this post. I will not error out it there is the no '# ABSTACT' nothing is added.

There is also one attribute that you can manipulate the above template with and the is the 'header' attribute with the default value of 'NAME'.

This I like as would rather 'Name' in my personal style, and to achieve this a quick edit the 'weaver.ini' file like this

[Name]
++header = Name
and after a clean and build with 'dzil' I get

=head1 Name

Database::Accessor::Manual - What is Database::Accessor, and how do I use it?


So that was easy.

The one think to remember is that you cannot do the above with the '[@Default]' template you have to use your own custom one. If you try something like this;

[@Default]

[Name]
header = Name

in your 'weaver.ini' file Pod::Weaver will just ignore the [Name] section as [@Default] already has one.

GodzillaPB-900px_900.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