Skip to content

Commit 09e71d4

Browse files
committed
readme: add badges
crates.io used to show some automatically per badge configuration in the crate toml files, however then they dropped this ([1]). crates now show badges via embedding them in readme.md files. shields.io is a popular service for constructing and serving badges, with a lot of available customisation. here i have selected the 'for-the-badge' style, which is similar to the nice 'flat-square' style, but uses capital letters and a default later height of 28px instead of 20px. I have used HTML for embedding them to allow control over the size, which I have forced to 24px since 28px is just too large. notes: - for the min-rust-version badge, there were two different URL formats available for custom badges, I went with the 'static' form which makes use of a lot of query params. - for the min-rust-version badge, I had to use capitals for the service text to get it consistent with the rest, since it was not automatically capitalising it. - for the docs.rs one i had to use the crates.io one with a custom colour and service text specified, since shields.io has a mechanism in place for automatically building the latest crates.io version number into the crates.io badge, but does not have a similar specific badge-builder available for docs.rs badges. (and the badge you can get from docs.rs itself is a different style of course). - the message for the min-rust-version is '1.40%2B' which is '1.40+'! i was inspired by the badges of the 'quote' crate. [1]: rust-lang/crates.io#2436
1 parent f295753 commit 09e71d4

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Overview
22
========
33

4+
[<img alt="travis.com" src="https://img.shields.io/travis/com/jnqnfe/gong?style=for-the-badge" height="24">](https://travis-ci.com/jnqnfe/gong)
5+
<img alt="license" src="https://img.shields.io/crates/l/gong.svg?style=for-the-badge" height="24">
6+
47
This repository contains `gong`, a lightweight, flexible and simple-to-use library provided to
58
assist in processing command line arguments in Rust based programs.
69

lib/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
gong
22
====
33

4+
[<img alt="travis.com" src="https://img.shields.io/travis/com/jnqnfe/gong?style=for-the-badge" height="24">](https://travis-ci.com/github/jnqnfe/gong)
5+
[<img alt="crates.io" src="https://img.shields.io/crates/v/gong?style=for-the-badge" height="24">](https://crates.io/crates/gong)
6+
[<img alt="docs.rs" src="https://img.shields.io/crates/v/gong?color=5479ab&label=docs.rs&style=for-the-badge" height="24">](https://docs.rs/gong)
7+
[<img alt="min-rust-version" src="https://img.shields.io/static/v1?label=RUST&message=1.26%2B&color=informational&style=for-the-badge" height="24">](https://rust-lang.github.io/rfcs/2495-min-rust-version.html)
8+
49
A lightweight, flexible and simple-to-use library provided to assist in processing command line
510
arguments.
611

0 commit comments

Comments
 (0)