Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: VERSION section in POD

by jandrew (Chaplain)
on May 19, 2016 at 00:36 UTC ( [id://1163390]=note: print w/replies, xml ) Need Help??


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!!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1163390]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2024-04-20 05:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found