New Feature for RepoCard: Showing Language Bar for multiple languages #4026
+276
−15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
RepoCard Feature: Show Language Bar
This feature enhances the
RepoCard
component by adding a language bar. Previously, the RepoCard displayed only the primary language, along with the number of forks and stars. In many cases, however, it’s helpful to show a broader view of the languages used in the repository, along with their relative proportions. This feature provides that additional context (see PybindExample below for reference).How does the feature work?
The feature introduces only one new parameter
show_lang_bar
and three that work the same as inTop Languages Card
show_lang_bar
If set to true, show the language bar (default is false)hide
: You can use &hide=language1,language2 parameter to hide individual languages.langs_count
: You can use the &langs_count= option to increase or decrease the number of languages shown on the card.hide_progress
: You can use the &hide_progress=true option to hide the percentages and the progress barBecause the default for
show_lang_bar
is set to false, no existing implementation/use will changeFurther Improvements:
Examples
Multiple Language with Bar:
show_lang_bar
= true andhide_progress
= falseMultiple Language without Bar:
show_lang_bar
= true andhide_progress
= falseOriginal:
show_lang_bar
= false (default)There is enough room to add the forks and stars (not yet added). Will add later if there enough interest in this feature
Pybind Example: