-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for displaying most used language (or 2nd, 3rd, 4th, ...) #209
Conversation
Thanks for doing this! Reusing the same endpoint and adding some more query parameters makes the code look much more elegant than what I was doing 😆
Just an idea for slightly more clear usage:
This might make sense where the number of languages is known, but might be a bit awkward when the number of languages is unknown and/or frequently change. Might make more sense for out-of-bounds language rankings to simply be |
…fault languageRank to 1.
Thank you for your PR! Sorry for the delay, but now that I merged your other PR, this has conflicts. Would you be interested in updating this one? |
Haven't looked into this for a while, will try deploying on onrender.com |
Thank you for your PR! |
Closes #87
Continues where #96 left off. Thank you @spenserblack for starting this.
Display the n-th most used language by enabling
?showLanguage=true
and using the?languageRank=n
query string, where n ∈[1, number of languages detected by tokei]For example,
Edge cases
?showLanguage=true
is not present, line count will be displayed as per default badge behavior.?showLanguage=true
but?languageRank=
not present, badge will display most used language.Live Demo
Repo: https://github.com/XAMPPRocky/tokei
Colors, badge styles, logos, and labels can be freely customized by the user.
It is possible to enable negative integers and get least-used, 2nd least used languages, ..., but this would probably be out of scope here.
Isranking
a suitable query parameter name?