Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Generating SVG Badges with Perl

by haukex (Archbishop)
on Nov 10, 2018 at 14:20 UTC ( [id://1225536]=CUFP: print w/replies, xml ) Need Help??

If you've looked at projects on GitHub or other sites, you may have noticed the little rectangular badges (aka shields) saying things like "build passing" with a nice green background (or yellow/red if something is wrong), and if you've used Travis CI or Coveralls, you probably know how to get these badges. There is also a nice service that can generate these badges for you, Shields.io, which is written in JavaScript.

There didn't seem to be anything like that for Perl, so I wrote Badge::Simple!

Thanks to a super quick turnaround by Kenichi Ishigaki, these badges are already integrated into CPANTS: Try accessing https://cpants.cpanauthors.org/dist/Your-Dist-Name.svg or https://cpants.cpanauthors.org/author/YOURCPANID.svg and you should see a badge for your Kwalitee score (PNG badges have also been available for quite some time, just use .png instead of .svg).

In the respository, you can find the script cpantesters.pl, which you can use to generate CPAN Testers badges for your CPAN modules. There is an open issue to perhaps integrate this directly with CPAN Testers, if anyone would like to take a stab at that, please feel free :-)

You can see all this in action, for example, in the Badge-Simple readme: the "Kwalitee" and "CPAN Testers" badges were generated with Perl!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://1225536]
Front-paged by stevieb
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (7)
As of 2024-04-23 20:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found