Dist::Zilla In C

It is C round up day today in the Dist-Pen.

In my last post I had a look at [Contributors] section plug-in and today I am going to look at not one but three plug-ins

  • CommentString
  • CollectWithAutoDoc and
  • CollectWithIntro

CommentString
This simple plug-in lets you do your own 'Comment' sections like we have seen with [Name] and [Contributors]. It works in much the same way as the [Collect] plug-in, you supply the 'name' for the section and then a 'key' to match on.

For example if I want to have a section for 'Notes' for any comments I may make I could do that by adding this into my 'Weaver.ini' file


[Region / postlude]
++[CommentString / Notes]
++comment = Note
[Authors]

and then in my POD files I could add a comment like this

# Note: Bob's Bargain Basement of Floppies it the best place to get these
=pod=cut

anywhere outside the POD comment and after the usual insall of the plug-in and the dzil clean and build I get

=head1 Notes
Bob's Bargain Basement of Floppies it the best place to get these
=head1 AUTHORS

in my POD. Just remember when using this one to use the correct format of keyword as seen above '# XXXX:' This one is very useful if you have design notes in the comments and want them in your POD.


CollectWithAutoDoc
This is one plug-in that I will not try to use but it is nice to know about. It is an alternative to using the [Collect] plug-in. It works in the same way you supply the 'name' and the 'key' and it gathers up any matches in the order in which it finds them in the POD.

What is special with this plug-in is that it will try to create any auto-generated documentation that may be present in the system. The plug-in also supports Sub::Documentation and Class::Accessor::Comple see the respective PODs for details on how to add this content to your code.


CollectWithIntro
This plug-in is yet another alternative to the [Collect] plug-in that works in the exact same manner only this one allows you to enter custom content from the 'weacer.ini' file.

Very useful for some POD documents and to try it out all I needed to do was swap out my TOC collection like this in my 'weaver.ini'


--[Collect / Table Of Contents]
++[CollectWithIntro / Table Of Contents]
++content = You can find more info at L<Database::Accssor>

The the install of the plug-in and the good old clean and build with dzil to get this content

='head2' Table Of Contents
You can find more info at L<Database::Accssor>
='head3' Database::Accessor::Tutorial::GettingStarted
A quick look at how to get started with Accessor

So no surprises there just some more plug-ins that may be useful.

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