Open waldyrious opened 6 years ago
For fine modification of badge, I think that you can use shields.io Dynamic badge feature. It is hard for this repository to fulfill many requests for badges.
Therefore, for example, how about designing to return JSON if not suffixing .svg
? (This probably needs to prefix /b2/
)
https://tokei.rs/b2/{github|gitlab}/{:user}/{:repo}/{:directory}?{opitons=hoge}
returns raw JSON.https://tokei.rs/b2/{github|gitlab}/{:user}/{:repo}/{:directory}.svg?{opitons=hoge}
returns SVG badge.options
is an option for Tokei. It is supposed to specify an option to exclude something, etc.
This fix is related to #8.
I agree that the label on the badge should be the lower case. There is room for discussion on how to describe LoC, but for other labels it should be fixed as a lower case.
@conao3 You can now get JSON if you supply Accept: application/json
in the request header.
@XAMPPRocky Can you provide an URL example about how to get JSON?
It seems that tokei can not work with shield.io now, right?
Sorry for bothering. I have figured it out. Just simply use the URL will work with shield.io.
If you've stumbled here, custom badge labels have been implemented in #166
I've yet to deploy that version, I hope to get to it soon, but will be a busy part of the year for me
(moved from https://github.com/Aaronepower/tokei/issues/139)
In tldr-pages/tldr we're using the file count badge as a proxy to the number of pages in the collection. Ideally we'd want to only count files in the pages directory (requested at #2), but even with the current count, which is already a good approximation, we'd want to change the label from "Files" to "pages". A feature to provide a custom label for the badge would enable us to do that.
On a related (but independent) note, I think the label should be lowercased to match the majority of default badge labels (see e.g. https://shields.io)