Dist::Zilla Looks Elsewhere
Well it is look elsewhere day here in the Dist-Pen today
Getting closer to the end of the road for Pod::Weaver::Section plug-ins I only have a few more to look at so I am going to look first at the ones I might find useful and then do a final wrap up of all the left overs.
Today I am going to look at the [SeeAlso] section plug-in. Fort my Database::Accessor project this might be a good one to have in there. As I will have a number of extra content I might want listed someplace, like links to the tutorial and manual and perhaps a link to a few DADs or a search for DADs
This plug-in does give you a number of options on how to enter the data for the section blurb. The most badsic is to add in the section your self in you pod and then the plug-in will convert them to a list.
For example if I enter this
++=head1 SEE ALSO
++
++Database::Accessor::Manual
++Database::Accessor::Tutorial
++Database::Accessor::Driver::WritersGuide
++Database::Accessor::Driver::SQL
=head1 SYNOPSIS
in my Accessor.pm and then this in my 'weaver.ini'
[Contributors]
all_modules=1
++[SeeAlso]
[Support]
and after I install the plug-in and do a clean and build with dzil I will get this
=head1 SEE ALSO
Please see those modules/websites for more information related to this module.
=over 4
=item *
L<Database::Accessor::Manual|Database::Accessor::Manual>
=item *
L<Database::Accessor::Tutorial|Database::Accessor::Tutorial>
=item *
L<Database::Accessor::Driver::WritersGuide|Database::Accessor::Driver::WritersGuide>
=item *
L<Database::Accessor::Driver::SQL|Database::Accessor::Driver::SQL>
=back
So I get exactly want I want a nice little list. You will also notice that I placed this code deliberately at the beginning my POD in the '.pm' file above the Synopsis but it ended up after the Contributors section. This is expected behaviour as what is going on is the section POD was collected from its original spot then weaved by the template to the spot I wanted it. Been a while since I did that.
The plug-in also lets you add in even more items on this list. It will actively look in sub modules for a similar block of POD and merge them with the one in the main module.
I am not limited to just POD entries like the above I can accomplish this by using comments as well.
For example I would like to have a link to the 'constant' pragma as I use that in 'Database::Accessor::Constants' so I could just add this into the Accessor.pm file ;
++# SEEALSO: constant
# Dist::Zilla: +PkgVersion
and on a clean and build I get
=item *
L<constant|constant>
=back
The plug-in comets with a few attributes I can play with. As usual there is a 'header' attribute where I can change 'SEE ALSO' to anything I want. There is also the 'add_main_link' attribute which is default to on and as such drops this
=head1 SEE ALSO
Please see those modules/websites for more information related to this module.
=over 4
=item *
L<Database::Accessor|Database::Accessor>
=back
into any sub files I may have in my distribution such as 'Database::Accessor::Types'. Unfortunately this is an all or nothing call so it also shows up in my tutorial and manual POD as well.
Finally there is the 'links' attribute that I can use to add in any extra links I may think of. So I can add in
[SeeAlso]
links = <database.accessor.org>
[Support]
to my 'weaver.ini' file and then after a clean and build I get
L<database.accessor.org>
=back
so that is nice as well.
That is about it for this plug-in I might find some use for it in the future.
Leave a comment