XAMPPRocky / tokei_rs

The tokei.rs server code.
Apache License 2.0
55 stars 11 forks source link

Feature request: customize badge label #3

Open waldyrious opened 6 years ago

waldyrious commented 6 years ago

(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)

conao3 commented 5 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/)

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.

XAMPPRocky commented 5 years ago

@conao3 You can now get JSON if you supply Accept: application/json in the request header.

rapiz1 commented 4 years ago

@XAMPPRocky Can you provide an URL example about how to get JSON?

rapiz1 commented 4 years ago

It seems that tokei can not work with shield.io now, right?

rapiz1 commented 4 years ago

Sorry for bothering. I have figured it out. Just simply use the URL will work with shield.io.

elliotwutingfeng commented 1 year ago

If you've stumbled here, custom badge labels have been implemented in #166

XAMPPRocky commented 1 year ago

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