NAME

Pod::Weaver::Section::Badges - Insert badges in your pod

VERSION

Version 0.0101, released 2015-02-15.

SYNOPSIS

; in weaver.ini
[Badges]
heading = BUILD STATUS
command = head1
user = MyGithubUser
repo = the_repository
branch = master
badges = travis
badges = http://www.example.com/img/<repo>.jpg | http://www.example.com/repos/<repo>
badges = https://img.shields.io/gratipay/<gratipay_user>.svg
-gratipay_user = ExampleName

DESCRIPTION

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>
    <a href="http://www.example.com/repos/the_repository"><img src="http://www.example.com/img/the_repository.jpg" /></a>
    <img src="https://img.shields.io/gratipay/the_repository/ExampleName.svg" />
</p>

=end HTML

ATTRIBUTES

badges

ArrayRef [ Str ] optional, default: [] read-only 'img_url' | 'link_url': Custom badges are created with a pipe-delimited string.
      travis: Support for travis is built-in.

The list of badges to create. This can either the name of a built-in badge (so far only travis) or a pipe-delimited string. The first value is the url for the badge, the second an optional url to make the badge clickable. Both urls take placeholders in the form of '<placeholder>' (without the quotes). See 'extras' for how to set them in weaver.ini.

branch

Str optional read-only

For use with the travis badge. The github branch. To use with custom badges, use '<branch>' in badge urls.

command

Str optional, default: head1 read-only

Heading level.

extras

HashRef [ Str ] optional, default: {} read-only

Custom settings for custom badges: Use any setting starting with a dash, in the badge urls those are replaced with the value given here. See 'badges' for how to define custom badges.

heading

Str optional, default: BADGES read-only

The heading under which the badges are added.

repo

Str optional read-only

For use with the travis badge. The github repository. To use with custom badges, use '<repo>' in badge urls.

user

Str optional read-only

For use with the travis badge. Your github username. To use with custom badges, use '<user>' in badge urls.

NOTE

Planned api changes: Badges will in the near future be created as plugins to this class.

SEE ALSO

BUILD STATUS

SOURCE

https://github.com/Csson/p5-Pod-Weaver-Section-Badges

HOMEPAGE

https://metacpan.org/release/Pod-Weaver-Section-Badges

AUTHOR

Erik Carlsson <info@code301.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Erik Carlsson <info@code301.com>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.