Putting a Travis badge in your Pod::Weaver document
So I recently got my Dzil-managed distribution to build on Travis CI. Now I wanted to put the badge in the Pod under the module name.
The normal way for putting it into your Pod is to add these lines:
=for html
<a href="https://travis-ci.org/stevenl/Test-Mocha"><img src="https://travis-ci.org/stevenl/Test-Mocha.svg?branch=master" alt="Build Status"></a>
The problem with this is I use Pod::Weaver which moves that into the [Leftovers]
section, at the bottom of the document. This article suggested moving Leftovers to the top. But then my problem was that Leftovers was already being used for other parts of my document.
My solution was to create a new region in weaver.ini
named badge
:
[Name]
[Region / badge]
[Version]
Then in my Pod I had:
=for :badge
=for html
<a href="https://travis-ci.org/stevenl/Test-Mocha"><img src="https://travis-ci.org/stevenl/Test-Mocha.svg?branch=master" alt="Build Status"></a>
And Pod::Weaver will put that in the badge region.
Written by Steven Lee
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Perl
Authors
janosgyerik
25.16K
Jean-Remy Duboc
12.25K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#