- SEE ALSO
- COPYRIGHT AND LICENSE
Pod::Weaver::Section::Badges - Add (or append) a section with badges
Version 0.0402, released 2016-02-20.
; in weaver.ini [Badges] section = BUILD STATUS formats = html badge = Travis badge = Gratipay -travis_user = MyGithubUser -travis_repo = the_repository -travis_branch = master -gratipay_user = ExampleName
This inserts a section with status badges. The configuration in the synopsis would produce something similar to this:
=head1 BUILD STATUS =begin HTML <p> <a href="https://travis-ci.org/MyGithubUser/the_repository"><img src="https://travis-ci.org/MyGithubUser/the_repository.svg?branch=master" /></a> <img src="https://img.shields.io/gratipay/ExampleName.svg" /> </p> =end HTML
This module uses badges in the
Badge::Depot::Plugin namespace. See Task::Badge::Depot for a list of available badges. The synopsis uses the Badge::Depot::Plugin::Travis and Badge::Depot::Plugin::Gratipay badges.
Attributes starting with a dash (such as, in the synopsis,
-gratipay_user) are given to each badge's constructor.
As a comparison with using badges and Badge::Depot directly, this is what
First, with this part of the synopsis:
[Badges] badge = Gratipay -gratipay_user = ExampleName
badge = Gratipay means that Badge::Depot::Plugin::Gratipay is automatically
-gratipay_user = Example means that this attribute is for the
Gratipay badge, so the prefix (
-gratipay_) is stripped and the attribute is given in the constructor:
my $gratipay_badge = Badge::Depot::Plugin::Gratipay->new(user => 'ExampleName');
And then the given
formats is used to render the pod:
my $rendered_badge = $gratipay_badge->to_html;
Which is then injected into the chosen
|ArrayRef [ Enum [ "html","markdown" ] ]||required||read-only|
The formats to render the badges for. Comma separated list, not multiple rows.
|ArrayRef [ Str ]||optional, default:
The name of the wanted badge, lowercased. Repeat for multiple badges. The name is everything after 'Badge::Depot::Plugin::'.
If true, the badges will only be inserted in the main module (as defined by Dist::Zilla). If false, they will be included in all modules.
The section of pod to add the badges to, identified by its heading. The section will be created if it doesn't already exist.
Some markdown renderers also renders '=begin html' blocks, which makes it unnecessary to set both html and markdown as output formats. Set this to a false value to produce both blocks.
Erik Carlsson <email@example.com>
This software is copyright (c) 2016 by Erik Carlsson.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.