http://www.perlmonks.org?node_id=1163390


in reply to VERSION section in POD

I've started adding the following badge section to my top level module pod so information is provided but maintenance is not required. This includes the minimum perl supported, current github version, CPAN version, Travis-CI state, Coveralls information, and Kwalitee score for that package.

Probably overkill but once it's set up you don't have to mess with it anymore. The down side is it will only display in browsers not in man pages. Inspect the various specific urls for your implementation substitutions. I generally put it right after the NAME section.

=begin html <a href="https://www.perl.org"> <img src="https://img.shields.io/badge/perl-5.10+-brightgreen.svg" + alt="perl version"> </a> <a href="https://travis-ci.org/jandrew/p5-spreadsheet-reader-excelxml" +> <img alt="Build Status" src="https://travis-ci.org/jandrew/p5-spre +adsheet-reader-excelxml.png?branch=master" alt='Travis Build'/> </a> <a href='https://coveralls.io/github/jandrew/p5-spreadsheet-reader-exc +elxml?branch=master'> <img src='https://coveralls.io/repos/github/jandrew/p5-spreadsheet +-reader-excelxml/badge.svg?branch=master' alt='Coverage Status' /> </a> <a href='https://github.com/jandrew/p5-spreadsheet-reader-excelxml'> <img src="https://img.shields.io/github/tag/jandrew/p5-spreadsheet +-reader-excelxml.svg?label=github version" alt="github version"/> </a> <a href="https://metacpan.org/pod/Spreadsheet::Reader::ExcelXML"> <img src="https://badge.fury.io/pl/Spreadsheet-Reader-ExcelXML.svg +?label=cpan version" alt="CPAN version" height="20"> </a> <a href='http://cpants.cpanauthors.org/dist/Spreadsheet-Reader-ExcelXM +L'> <img src='http://cpants.cpanauthors.org/dist/Spreadsheet-Reader-Ex +celXML.png' alt='kwalitee' height="20"/> </a> =end html

For the github badge to work you have to draft a release with the package version as the 'Tag version'

Replies are listed 'Best First'.
Re^2: VERSION section in POD
by polettix (Vicar) on May 19, 2016 at 07:15 UTC
    This is a very interesting idea. As you correctly point out, it's available in the browser only (so it deviates a bit from what I had in mind in the first place), but it's neat indeed and worth considering (the badges in your modules' pages in metacpan are awesome).

    Definitely goes into my "Today I Learned..." bucket, thanks!

    perl -ple'$_=reverse' <<<ti.xittelop@oivalf

    Io ho capito... ma tu che hai detto?
Re^2: VERSION section in POD
by RonW (Parson) on May 20, 2016 at 19:27 UTC

    Looking at this more closely, it appears to always link to the info about the latest version instead of the version "in hand".

    Still, this is interesting.

      RonW you are correct that the links as shown will always give the latest versions. It is possible to hard code the versions and links to their repos into each badge. See the perl version badge for an example that does just that. Shields.io is a pretty flexible resource for a lot of things in that area. If you do that you're back to the the original issue of having to hand roll the versions in the pod or use a tool like the one suggested by choroba++ (perl-reversion). All/most/(all the good) Pod readers explicitly strip dynamic code for safety. This includes anything that would import the value for the $VERSION variable. I think that perl-reversion or something like it is a good idea I just went down a different path. I suppose my initial post was mostly responding to the part of the OP that asked how other people handle version in their pod. I don't have any compelling reason to say my way is best practice. It's just the way I do it. I suppose that with some work and a parser you could have both hard coded badges and text versions posted I just never went that far. TIMTOWTDI!!