github-readme-stats
github-readme-stats copied to clipboard
show stats for specific organizations or repositories
This PR adds new functionality to show contribution stats for specific repositories and organizations.
GitHub Stats Card changes
Add optional parameters &repos=userA/repoA,orgB/repoB and &owners=userC,orgD to filter the user's contributions by repo or organization.
GitHub Extra Pins (Repo Card) changes
Add optional parameter &show=prs_authored,prs_commented,prs_reviewed,issues_authored,issues_commented to display the user's contribution to the pinned repository.
Supporting changes
-
Add 5 new options to
show: prs_authored, prs_commented, prs_reviewed, issues_authored and issues_commented.They are similar to some existing options, e.g.
issues_authoredis similar toissues. The difference is how these values are fetched - via GraphQL or via REST API. The pre-existing items use GraphQL, but filtering by repository or owner works better via REST API. -
Add some style options to GitHub Extra Pins (Repo Card) which existed already for GitHub Stats card: card_width, show_icons, line_height, text_bold, number_format and show. They only affect the style of the new options introduced in this PR.
-
update readme with new descriptions and examples
-
allow user-specified card_width parameter to be smaller than internally computed minimum width. If the user explicitly asks for a specific display width, there's no need to prevent this. Especially with the new stats options I found smaller widths helpful.
-
For GitHub Extra Pins (Repo Card), the
repoparameter can now optionally include the repo owner. This is useful for showing user A's contributions to user B's repository. -
Make the new individual stats clickable links. Links lead to the list of relevant contributions, e.g. a list of the user's created PRs (in a specific repository). However, GitHub turns the whole image into a link, so this feature isn't too useful. People have to click the image first, which opens it in a new tab, then in the new tab again click the specific stat that they are interested in. Alternatively, if the generated images are embedded on another site than GitHub, the new links are directly clickable.
-
minor adjustments of rendering logic to support new features, more informative error messages, etc.
Demo
anuraghazra's contributions to github-readme-stats:
anurag's contributions to razorpay:
A version of github-readme-stats including my changes is available here for testing. A fork with my changes is available at https://github.com/martin-mfg/github-readme-stats/tree/readme-test. Feel free to fork and host your own version while this PR is being reviewed.
Motivation
As contributor in another Open Source project, I wanted to have an overview of my own contributions to that specific project. And I wanted to display this overview on my GitHub profile page. I think other Open Source contributors might find this useful too.