You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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. (there is a query-param available to control width but not
height for some reason).
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
0 commit comments