Merge branch 'technical-improvements' into user-management

This commit is contained in:
martin-mfg
2025-09-09 19:24:44 +02:00
21 changed files with 461 additions and 487 deletions
+6
View File
@@ -0,0 +1,6 @@
# This file is used to define code owners for the repository.
# Code owners are automatically requested for review when someone opens a pull request that modifies code they own.
# Assign @qwerty541 as the owner for package.json and package-lock.json
package.json @qwerty541
package-lock.json @qwerty541
-4
View File
@@ -9,8 +9,6 @@ updates:
commit-message:
prefix: "build(deps)"
prefix-development: "build(deps-dev)"
reviewers:
- "qwerty541"
# Maintain dependencies for GitHub Actions
- package-ecosystem: github-actions
@@ -21,5 +19,3 @@ updates:
commit-message:
prefix: "ci(deps)"
prefix-development: "ci(deps-dev)"
reviewers:
- "qwerty541"
+1 -1
View File
@@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: ${{ matrix.node-version }}
cache: npm
+2 -1
View File
@@ -5,6 +5,7 @@ on:
- master
paths:
- "themes/index.js"
workflow_dispatch:
permissions:
actions: read
@@ -32,7 +33,7 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: ${{ matrix.node-version }}
cache: npm
+1 -1
View File
@@ -21,7 +21,7 @@ jobs:
if: github.repository == 'anuraghazra/github-readme-stats'
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
- uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true
+8 -7
View File
@@ -1,11 +1,12 @@
name: Theme preview
on:
pull_request_target:
types: [opened, edited, reopened, synchronize]
branches:
- master
paths:
- "themes/index.js"
# pull_request_target:
# types: [opened, edited, reopened, synchronize]
# branches:
# - master
# paths:
# - "themes/index.js"
workflow_dispatch:
permissions:
actions: read
@@ -33,7 +34,7 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: ${{ matrix.node-version }}
cache: npm
+1 -1
View File
@@ -1,4 +1,4 @@
name: prs cache clean
name: Cleanup closed pull requests cache
on:
pull_request:
types:
+13 -12
View File
@@ -1,16 +1,17 @@
name: Close stale theme pull requests that have the 'invalid' label.
on:
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
- cron: "0 0 */7 * *"
# schedule:
# # ┌───────────── minute (0 - 59)
# # │ ┌───────────── hour (0 - 23)
# # │ │ ┌───────────── day of the month (1 - 31)
# # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# # │ │ │ │ │
# # │ │ │ │ │
# # │ │ │ │ │
# # * * * * *
# - cron: "0 0 */7 * *"
workflow_dispatch:
permissions:
actions: read
@@ -39,7 +40,7 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: ${{ matrix.node-version }}
cache: npm
+1 -1
View File
@@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: ${{ matrix.node-version }}
cache: npm
+3 -1
View File
@@ -25,7 +25,7 @@ jobs:
steps:
- name: Check out the code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Set up Git
run: |
@@ -39,3 +39,5 @@ jobs:
for pr_number in $(gh pr list -l "themes" -q is:open --json number -q ".[].number"); do
gh pr close $pr_number -c "$comment_message"
done
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+1 -1
View File
@@ -39,7 +39,7 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: ${{ matrix.node-version }}
cache: npm
+2
View File
@@ -12,3 +12,5 @@ vercel_token
!.vscode/extensions.json
!.vscode/settings.json
*.code-workspace
.vercel
+2 -1
View File
@@ -2,6 +2,7 @@
"recommendations": [
"yzhang.markdown-all-in-one",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint"
"dbaeumer.vscode-eslint",
"ms-azuretools.vscode-containers"
]
}
+5 -3
View File
@@ -1,6 +1,7 @@
import { renderTopLanguages } from "../src/cards/top-languages.js";
import { blacklist } from "../src/common/blacklist.js";
import {
clampValue,
CONSTANTS,
parseArray,
parseBoolean,
@@ -73,9 +74,10 @@ export default async (req, res) => {
parseArray(role),
);
let cacheSeconds = parseInt(
cache_seconds || CONSTANTS.TOP_LANGS_CACHE_SECONDS,
10,
let cacheSeconds = clampValue(
parseInt(cache_seconds || CONSTANTS.TOP_LANGS_CACHE_SECONDS, 10),
CONSTANTS.FOUR_HOURS,
CONSTANTS.TEN_DAY,
);
cacheSeconds = process.env.CACHE_SECONDS
? parseInt(process.env.CACHE_SECONDS, 10) || cacheSeconds
+239 -264
View File
File diff suppressed because it is too large Load Diff
+8 -8
View File
@@ -39,31 +39,31 @@
"@actions/core": "^1.11.1",
"@actions/github": "^6.0.1",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.33.0",
"@eslint/js": "^9.35.0",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.6.4",
"@testing-library/jest-dom": "^6.8.0",
"@uppercod/css-to-object": "^1.1.1",
"axios-mock-adapter": "^2.1.0",
"color-contrast-checker": "^2.1.0",
"eslint": "^9.33.0",
"eslint": "^9.35.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-jsdoc": "^54.1.0",
"eslint-plugin-jsdoc": "^54.5.0",
"globals": "^16.3.0",
"hjson": "^3.2.2",
"husky": "^9.1.7",
"jest": "^29.7.0",
"jest-bench": "^29.7.1",
"jest-environment-jsdom": "^30.0.5",
"jest-environment-jsdom": "^30.1.2",
"js-yaml": "^4.1.0",
"lint-staged": "^16.1.5",
"lint-staged": "^16.1.6",
"lodash.snakecase": "^4.1.1",
"parse-diff": "^0.11.1",
"prettier": "^3.6.2"
},
"dependencies": {
"axios": "^1.11.0",
"dotenv": "^17.2.1",
"emoji-name-map": "^1.2.8",
"dotenv": "^17.2.2",
"emoji-name-map": "^2.0.3",
"github-username-regex": "^1.0.0",
"pg": "^8.16.2",
"upgrade": "^1.1.0",
+133 -123
View File
@@ -3,62 +3,50 @@
<h2 align="center">GitHub Readme Stats</h2>
<p align="center">Get dynamically generated GitHub stats on your READMEs!</p>
</p>
<p align="center">
<a href="https://github.com/anuraghazra/github-readme-stats/actions">
<img alt="Tests Passing" src="https://github.com/anuraghazra/github-readme-stats/workflows/Test/badge.svg" />
</a>
<a href="https://github.com/anuraghazra/github-readme-stats/graphs/contributors">
<img alt="GitHub Contributors" src="https://img.shields.io/github/contributors/anuraghazra/github-readme-stats" />
</a>
<a href="https://codecov.io/gh/anuraghazra/github-readme-stats">
<img alt="Tests Coverage" src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
</a>
<a href="https://github.com/anuraghazra/github-readme-stats/issues">
<img alt="Issues" src="https://img.shields.io/github/issues/anuraghazra/github-readme-stats?color=0088ff" />
</a>
<a href="https://github.com/anuraghazra/github-readme-stats/pulls">
<img alt="GitHub pull requests" src="https://img.shields.io/github/issues-pr/anuraghazra/github-readme-stats?color=0088ff" />
</a>
<a href="https://securityscorecards.dev/viewer/?uri=github.com/anuraghazra/github-readme-stats">
<img alt="OpenSSF Scorecard" src="https://api.securityscorecards.dev/projects/github.com/anuraghazra/github-readme-stats/badge" />
</a>
<br />
<br />
<a href="https://vercel.com?utm\_source=github\_readme\_stats\_team\&utm\_campaign=oss">
<img src="./powered-by-vercel.svg"/>
</a>
</p>
<p align="center">
<a href="#all-demos">View Demo</a>
·
<a href="https://github.com/anuraghazra/github-readme-stats/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml">Report Bug</a>
·
<a href="https://github.com/anuraghazra/github-readme-stats/issues/new?assignees=&labels=enhancement&projects=&template=feature_request.yml">Request Feature</a>
·
<a href="https://github.com/anuraghazra/github-readme-stats/discussions/1770">FAQ</a>
·
<a href="https://github.com/anuraghazra/github-readme-stats/discussions/new?category=q-a">Ask Question</a>
</p>
<p align="center">
<a href="https://github.com/anuraghazra/github-readme-stats/actions">
<img alt="Tests Passing" src="https://github.com/anuraghazra/github-readme-stats/workflows/Test/badge.svg" />
</a>
<a href="https://github.com/anuraghazra/github-readme-stats/graphs/contributors">
<img alt="GitHub Contributors" src="https://img.shields.io/github/contributors/anuraghazra/github-readme-stats" />
</a>
<a href="https://codecov.io/gh/anuraghazra/github-readme-stats">
<img alt="Tests Coverage" src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
</a>
<a href="https://github.com/anuraghazra/github-readme-stats/issues">
<img alt="Issues" src="https://img.shields.io/github/issues/anuraghazra/github-readme-stats?color=0088ff" />
</a>
<a href="https://github.com/anuraghazra/github-readme-stats/pulls">
<img alt="GitHub pull requests" src="https://img.shields.io/github/issues-pr/anuraghazra/github-readme-stats?color=0088ff" />
</a>
<a href="https://securityscorecards.dev/viewer/?uri=github.com/anuraghazra/github-readme-stats">
<img alt="OpenSSF Scorecard" src="https://api.securityscorecards.dev/projects/github.com/anuraghazra/github-readme-stats/badge" />
</a>
<br />
<br />
<a href="https://vercel.com?utm\_source=github\_readme\_stats\_team\&utm\_campaign=oss">
<img src="./powered-by-vercel.svg"/>
</a>
</p>
<p align="center">
<a href="#all-demos">View Demo</a>
·
<a href="https://github.com/anuraghazra/github-readme-stats/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml">Report Bug</a>
·
<a href="https://github.com/anuraghazra/github-readme-stats/issues/new?assignees=&labels=enhancement&projects=&template=feature_request.yml">Request Feature</a>
·
<a href="https://github.com/anuraghazra/github-readme-stats/discussions/1770">FAQ</a>
·
<a href="https://github.com/anuraghazra/github-readme-stats/discussions/new?category=q-a">Ask Question</a>
</p>
<p align="center">Love the project? Please consider <a href="https://www.paypal.me/anuraghazra">donating</a> to help it improve!</p>
<a href="https://indiafightscorona.giveindia.org">
<img src="https://cfstatic.give.do/logo.png" alt="Give india logo" width="200" />
</a>
Are you considering supporting the project by donating to me? Please DO NOT!!!
<img src="https://cfstatic.give.do/910ede2a-7892-43fe-8c8a-dea45e96d950.webp" alt="Picture of Coromandel Express train tragedy" width="35%">
India has recently suffered one of the most devastating train accidents, and your help will be immensely valuable for the people who were affected by this tragedy.
Please visit [this link](https://give.do/fundraisers/stand-beside-the-victims-of-the-coromandel-express-train-tragedy-in-odisha-donate-now) and make a small donation to help the people in need. A small donation goes a long way. :heart:
</p>
# Features <!-- omit in toc -->
<details>
<summary>Table of contents (Click to show)</summary>
- [GitHub Stats Card](#github-stats-card)
- [Hiding individual stats](#hiding-individual-stats)
@@ -69,12 +57,15 @@ Please visit [this link](https://give.do/fundraisers/stand-beside-the-victims-of
- [Customization](#customization)
- [GitHub Extra Pins](#github-extra-pins)
- [Usage](#usage)
- [Options](#options)
- [Demo](#demo)
- [GitHub Gist Pins](#github-gist-pins)
- [Usage](#usage-1)
- [Options](#options-1)
- [Demo](#demo-1)
- [Top Languages Card](#top-languages-card)
- [Usage](#usage-2)
- [Options](#options-2)
- [Language stats algorithm](#language-stats-algorithm)
- [Exclude individual repositories](#exclude-individual-repositories)
- [Hide individual languages](#hide-individual-languages)
@@ -86,9 +77,12 @@ Please visit [this link](https://give.do/fundraisers/stand-beside-the-victims-of
- [Hide Progress Bars](#hide-progress-bars)
- [Demo](#demo-2)
- [WakaTime Stats Card](#wakatime-stats-card)
- [Options](#options-3)
- [Demo](#demo-3)
- [All Demos](#all-demos)
- [Quick Tip (Align The Cards)](#quick-tip-align-the-cards)
- [Stats and top languages cards](#stats-and-top-languages-cards)
- [Pinning repositories](#pinning-repositories)
- [Deploy on your own](#deploy-on-your-own)
- [On Vercel](#on-vercel)
- [:film\_projector: Check Out Step By Step Video Tutorial By @codeSTACKr](#film_projector-check-out-step-by-step-video-tutorial-by-codestackr)
@@ -96,11 +90,12 @@ Please visit [this link](https://give.do/fundraisers/stand-beside-the-victims-of
- [Disable rate limit protections](#disable-rate-limit-protections)
- [Keep your fork up to date](#keep-your-fork-up-to-date)
- [:sparkling\_heart: Support the project](#sparkling_heart-support-the-project)
</details>
# Important Notices <!-- omit in toc -->
> [!IMPORTANT]\
> Since the GitHub API only [allows 5k requests per hour per user account](https://docs.github.com/en/graphql/overview/resource-limitations), the public Vercel instance hosted on `https://github-readme-stats.vercel.app/api` could possibly hit the rate limiter (see [#1471](https://github.com/anuraghazra/github-readme-stats/issues/1471)). We use caching to prevent this from happening (see https://github.com/anuraghazra/github-readme-stats#common-options). You can turn off these rate limit protections by deploying [your own Vercel instance](#disable-rate-limit-protections).
> Since the GitHub API only [allows 5k requests per hour per user account](https://docs.github.com/en/graphql/overview/resource-limitations), the public Vercel instance hosted on `https://github-readme-stats-phi-jet-58.vercel.app/api` could possibly hit the rate limiter (see [#1471](https://github.com/anuraghazra/github-readme-stats/issues/1471)). We use caching to prevent this from happening (see https://github.com/anuraghazra/github-readme-stats#common-options). You can turn off these rate limit protections by deploying [your own Vercel instance](#disable-rate-limit-protections).
<img alt="Uptime Badge" src="https://img.shields.io/endpoint?url=https%3A%2F%2Fgithub-readme-stats-git-monitoring-github-readme-stats-team.vercel.app%2Fapi%2Fstatus%2Fup%3Ftype%3Dshields">
@@ -374,62 +369,6 @@ If we don't support your language, please consider contributing! You can find mo
> [!NOTE]\
> When hide\_rank=`true`, the minimum card width is 270 px + the title length and padding.
#### Repo Card Exclusive Options
| Name | Description | Type | Default value |
| --- | --- | --- | --- |
| `show_owner` | Shows the repo's owner name. | boolean | `false` |
| `description_lines_count` | Manually set the number of lines for the description. Specified value will be clamped between 1 and 3. If this parameter is not specified, the number of lines will be automatically adjusted according to the actual length of the description. | number | `null` |
| `card_width` | Sets the card's width manually. | number | `400px (approx.)` |
| `show_icons` | Shows icons near all stats enabled via `show`. | boolean | `true` |
| `line_height` | Sets the line height between stats enabled via `show`. | integer | `22` |
| `text_bold` | Uses bold text for all stats enabled via `show`. | boolean | `false` |
| `number_format` | Switches between two available formats for displaying the numbers for all stats enabled via `show`: `short` (i.e. `6.6k`) and `long` (i.e. `6626`). | enum | `short` |
| `show` | Shows [additional items](#showing-additional-individual-stats) on stats card (i.e. `prs_authored`, `prs_commented`, `prs_reviewed`, `issues_authored` or `issues_commented`). | string (comma-separated values) | `null` |
#### Gist Card Exclusive Options
| Name | Description | Type | Default value |
| --- | --- | --- | --- |
| `show_owner` | Shows the gist's owner name. | boolean | `false` |
#### Language Card Exclusive Options
| Name | Description | Type | Default value |
| --- | --- | --- | --- |
| `hide` | Hides the [specified languages](#hide-individual-languages) from card. | string (comma-separated values) | `null` |
| `hide_title` | Hides the title of your card. | boolean | `false` |
| `layout` | Switches between five available layouts `normal` & `compact` & `donut` & `donut-vertical` & `pie`. | enum | `normal` |
| `card_width` | Sets the card's width manually. | number | `300` |
| `langs_count` | Shows more languages on the card, between 1-20. | integer | `5` for `normal` and `donut`, `6` for other layouts |
| `exclude_repo` | Excludes specified repositories. | string (comma-separated values) | `null` |
| `role` | Include repositories where the user has one of the specified [roles](https://docs.github.com/en/graphql/reference/enums#repositoryaffiliation) (OWNER, ORGANIZATION_MEMBER, COLLABORATOR). | string (comma-separated values) | `OWNER` |
| `custom_title` | Sets a custom title for the card. | string | `Most Used Languages` |
| `disable_animations` | Disables all animations in the card. | boolean | `false` |
| `hide_progress` | Uses the compact layout option, hides percentages, and removes the bars. | boolean | `false` |
| `size_weight` | Configures language stats algorithm (see [Language stats algorithm](#language-stats-algorithm)). | integer | `1` |
| `count_weight` | Configures language stats algorithm (see [Language stats algorithm](#language-stats-algorithm)). | integer | `0` |
> [!WARNING]\
> Language names should be URI-escaped, as specified in [Percent Encoding](https://en.wikipedia.org/wiki/Percent-encoding)
> (i.e: `c++` should become `c%2B%2B`, `jupyter notebook` should become `jupyter%20notebook`, etc.) You can use
> [urlencoder.org](https://www.urlencoder.org/) to help you do this automatically.
#### WakaTime Card Exclusive Options
| Name | Description | Type | Default value |
| --- | --- | --- | --- |
| `hide` | Hides the languages specified from the card. | string (comma-separated values) | `null` |
| `hide_title` | Hides the title of your card. | boolean | `false` |
| `line_height` | Sets the line height between text. | integer | `25` |
| `hide_progress` | Hides the progress bar and percentage. | boolean | `false` |
| `custom_title` | Sets a custom title for the card. | string | `WakaTime Stats` |
| `layout` | Switches between two available layouts `default` & `compact`. | enum | `default` |
| `langs_count` | Limits the number of languages on the card, defaults to all reported languages. | integer | `null` |
| `api_domain` | Sets a custom API domain for the card, e.g. to use services like [Hakatime](https://github.com/mujx/hakatime) or [Wakapi](https://github.com/muety/wakapi) | string | `wakatime.com` |
| `display_format` | Sets the WakaTime stats display format. Choose `time` to display time-based stats or `percent` to show percentages. | enum | `time` |
| `disable_animations` | Disables all animations in the card. | boolean | `false` |
***
# GitHub Extra Pins
@@ -448,15 +387,30 @@ Endpoint: `api/pin?username=anuraghazra&repo=github-readme-stats`
[![Readme Card](https://github-readme-stats-phi-jet-58.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats)](https://github.com/anuraghazra/github-readme-stats)
```
### Options
You can customize the appearance and behavior of the pinned repository card using the [common options](#common-options) and exclusive options listed in the table below.
| Name | Description | Type | Default value |
| --- | --- | --- | --- |
| `show_owner` | Shows the repo's owner name. | boolean | `false` |
| `description_lines_count` | Manually set the number of lines for the description. Specified value will be clamped between 1 and 3. If this parameter is not specified, the number of lines will be automatically adjusted according to the actual length of the description. | number | `null` |
| `card_width` | Sets the card's width manually. | number | `400px (approx.)` |
| `show_icons` | Shows icons near all stats enabled via `show`. | boolean | `true` |
| `line_height` | Sets the line height between stats enabled via `show`. | integer | `22` |
| `text_bold` | Uses bold text for all stats enabled via `show`. | boolean | `false` |
| `number_format` | Switches between two available formats for displaying the numbers for all stats enabled via `show`: `short` (i.e. `6.6k`) and `long` (i.e. `6626`). | enum | `short` |
| `show` | Shows [additional items](#showing-additional-individual-stats) on stats card (i.e. `prs_authored`, `prs_commented`, `prs_reviewed`, `issues_authored` or `issues_commented`). | string (comma-separated values) | `null` |
### Demo
![Readme Card](https://github-readme-stats-phi-jet-58.vercel.app/api/pin/?username=anuraghazra\&repo=github-readme-stats)
Use [show\_owner](#repo-card-exclusive-options) query option to include the repo's owner username:
Use [show\_owner](#options) query option to include the repo's owner username:
![Readme Card](https://github-readme-stats-phi-jet-58.vercel.app/api/pin/?username=anuraghazra\&repo=github-readme-stats\&show_owner=true)
Use [show](#repo-card-exclusive-options) query option to display the user's contributions to the repository:
Use [show](#options) query option to display the user's contributions to the repository:
![Readme Card](https://github-readme-stats-phi-jet-58.vercel.app/api/pin/?username=anuraghazra\&repo=github-readme-stats\&show=prs_authored,prs_commented,prs_reviewed,issues_authored,issues_commented)
@@ -478,11 +432,19 @@ Endpoint: `api/gist?id=bbfce31e0217a3689c8d961a356cb10d`
[![Gist Card](https://github-readme-stats-phi-jet-58.vercel.app/api/gist?id=bbfce31e0217a3689c8d961a356cb10d)](https://gist.github.com/Yizack/bbfce31e0217a3689c8d961a356cb10d/)
```
### Options
You can customize the appearance and behavior of the gist card using the [common options](#common-options) and exclusive options listed in the table below.
| Name | Description | Type | Default value |
| --- | --- | --- | --- |
| `show_owner` | Shows the gist's owner name. | boolean | `false` |
### Demo
![Gist Card](https://github-readme-stats-phi-jet-58.vercel.app/api/gist?id=bbfce31e0217a3689c8d961a356cb10d)
Use [show\_owner](#gist-card-exclusive-options) query option to include the gist's owner username
Use [show\_owner](#options-1) query option to include the gist's owner username
![Gist Card](https://github-readme-stats-phi-jet-58.vercel.app/api/gist?id=bbfce31e0217a3689c8d961a356cb10d\&show_owner=true)
@@ -512,6 +474,30 @@ Endpoint: `api/top-langs?username=anuraghazra`
[![Top Langs](https://github-readme-stats-phi-jet-58.vercel.app/api/top-langs/?username=anuraghazra)](https://github.com/anuraghazra/github-readme-stats)
```
### Options
You can customize the appearance and behavior of the top languages card using the [common options](#common-options) and exclusive options listed in the table below.
| Name | Description | Type | Default value |
| --- | --- | --- | --- |
| `hide` | Hides the [specified languages](#hide-individual-languages) from card. | string (comma-separated values) | `null` |
| `hide_title` | Hides the title of your card. | boolean | `false` |
| `layout` | Switches between five available layouts `normal` & `compact` & `donut` & `donut-vertical` & `pie`. | enum | `normal` |
| `card_width` | Sets the card's width manually. | number | `300` |
| `langs_count` | Shows more languages on the card, between 1-20. | integer | `5` for `normal` and `donut`, `6` for other layouts |
| `exclude_repo` | Excludes specified repositories. | string (comma-separated values) | `null` |
| `role` | Include repositories where the user has one of the specified [roles](https://docs.github.com/en/graphql/reference/enums#repositoryaffiliation) (OWNER, ORGANIZATION_MEMBER, COLLABORATOR). | string (comma-separated values) | `OWNER` |
| `custom_title` | Sets a custom title for the card. | string | `Most Used Languages` |
| `disable_animations` | Disables all animations in the card. | boolean | `false` |
| `hide_progress` | Uses the compact layout option, hides percentages, and removes the bars. | boolean | `false` |
| `size_weight` | Configures language stats algorithm (see [Language stats algorithm](#language-stats-algorithm)). | integer | `1` |
| `count_weight` | Configures language stats algorithm (see [Language stats algorithm](#language-stats-algorithm)). | integer | `0` |
> [!WARNING]\
> Language names should be URI-escaped, as specified in [Percent Encoding](https://en.wikipedia.org/wiki/Percent-encoding)
> (i.e: `c++` should become `c%2B%2B`, `jupyter notebook` should become `jupyter%20notebook`, etc.) You can use
> [urlencoder.org](https://www.urlencoder.org/) to help you do this automatically.
### Language stats algorithm
We use the following algorithm to calculate the languages percentages on the language card:
@@ -629,6 +615,23 @@ Change the `?username=` value to your [WakaTime](https://wakatime.com) username.
[![Harlok's WakaTime stats](https://github-readme-stats-phi-jet-58.vercel.app/api/wakatime?username=ffflabs)](https://github.com/anuraghazra/github-readme-stats)
```
### Options
You can customize the appearance and behavior of the WakaTime stats card using the [common options](#common-options) and exclusive options listed in the table below.
| Name | Description | Type | Default value |
| --- | --- | --- | --- |
| `hide` | Hides the languages specified from the card. | string (comma-separated values) | `null` |
| `hide_title` | Hides the title of your card. | boolean | `false` |
| `line_height` | Sets the line height between text. | integer | `25` |
| `hide_progress` | Hides the progress bar and percentage. | boolean | `false` |
| `custom_title` | Sets a custom title for the card. | string | `WakaTime Stats` |
| `layout` | Switches between two available layouts `default` & `compact`. | enum | `default` |
| `langs_count` | Limits the number of languages on the card, defaults to all reported languages. | integer | `null` |
| `api_domain` | Sets a custom API domain for the card, e.g. to use services like [Hakatime](https://github.com/mujx/hakatime) or [Wakapi](https://github.com/muety/wakapi) | string | `wakatime.com` |
| `display_format` | Sets the WakaTime stats display format. Choose `time` to display time-based stats or `percent` to show percentages. | enum | `time` |
| `disable_animations` | Disables all animations in the card. | boolean | `false` |
### Demo
![Harlok's WakaTime stats](https://github-readme-stats-phi-jet-58.vercel.app/api/wakatime?username=ffflabs)
@@ -725,7 +728,9 @@ Choose from any of the [default themes](#themes)
## Quick Tip (Align The Cards)
By default, GitHub does not lay out the cards side by side. To do that, you can use this approach:
By default, GitHub does not lay out the cards side by side. To do that, you can use such approaches:
### Stats and top languages cards
```html
<a href="https://github.com/anuraghazra/github-readme-stats">
@@ -736,15 +741,6 @@ By default, GitHub does not lay out the cards side by side. To do that, you can
</a>
```
```html
<a href="https://github.com/anuraghazra/github-readme-stats">
<img align="center" src="https://github-readme-stats-phi-jet-58.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats" />
</a>
<a href="https://github.com/anuraghazra/convoychat">
<img align="center" src="https://github-readme-stats-phi-jet-58.vercel.app/api/pin/?username=anuraghazra&repo=convoychat" />
</a>
```
<details>
<summary>:eyes: Show example</summary>
@@ -755,7 +751,21 @@ By default, GitHub does not lay out the cards side by side. To do that, you can
<img height=200 align="center" src="https://github-readme-stats-phi-jet-58.vercel.app/api/top-langs?username=anuraghazra&layout=compact&langs_count=8&card_width=320" />
</a>
***
</details>
### Pinning repositories
```html
<a href="https://github.com/anuraghazra/github-readme-stats">
<img align="center" src="https://github-readme-stats-phi-jet-58.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats" />
</a>
<a href="https://github.com/anuraghazra/convoychat">
<img align="center" src="https://github-readme-stats-phi-jet-58.vercel.app/api/pin/?username=anuraghazra&repo=convoychat" />
</a>
```
<details>
<summary>:eyes: Show example</summary>
<a href="https://github.com/anuraghazra/github-readme-stats">
<img align="center" src="https://github-readme-stats-phi-jet-58.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats" />
@@ -772,7 +782,7 @@ By default, GitHub does not lay out the cards side by side. To do that, you can
### :film\_projector: [Check Out Step By Step Video Tutorial By @codeSTACKr](https://youtu.be/n6d4KHSKqGk?t=107)
Since the GitHub API only allows 5k requests per hour, my `https://github-readme-stats.vercel.app/api` could possibly hit the rate limiter. If you host it on your own Vercel server, then you do not have to worry about anything. Click on the deploy button to get started!
Since the GitHub API only allows 5k requests per hour, my `https://github-readme-stats-phi-jet-58.vercel.app/api` could possibly hit the rate limiter. If you host it on your own Vercel server, then you do not have to worry about anything. Click on the deploy button to get started!
> [!NOTE]\
> Since [#58](https://github.com/anuraghazra/github-readme-stats/pull/58), we should be able to handle more than 5k requests and have fewer issues with downtime :grin:.
+2 -15
View File
@@ -22,7 +22,7 @@ Use \`?theme=THEME_NAME\` parameter like so:
## Stats
> These themes works with all five our cards: Stats Card, Repo Card, Gist Card, Top languages Card and WakaTime Card.
> These themes work with all five of our cards: Stats Card, Repo Card, Gist Card, Top Languages Card, and WakaTime Card.
| | | |
| :--: | :--: | :--: |
@@ -30,7 +30,7 @@ ${STAT_CARD_TABLE_FLAG}
## Repo Card
> These themes works with all five our cards: Stats Card, Repo Card, Gist Card, Top languages Card and WakaTime Card.
> These themes work with all five of our cards: Stats Card, Repo Card, Gist Card, Top Languages Card, and WakaTime Card.
| | | |
| :--: | :--: | :--: |
@@ -39,11 +39,6 @@ ${REPO_CARD_TABLE_FLAG}
${STAT_CARD_LINKS_FLAG}
${REPO_CARD_LINKS_FLAG}
[add-theme]: https://github.com/anuraghazra/github-readme-stats/edit/master/themes/index.js
Want to add a new theme? Consider reading the [contribution guidelines](../CONTRIBUTING.md#themes-contribution) :D
`;
const createRepoMdLink = (theme) => {
@@ -81,15 +76,7 @@ const generateTable = ({ isRepoCard }) => {
let tableItem2 = createTableItem({ link: two, label: two, isRepoCard });
let tableItem3 = createTableItem({ link: three, label: three, isRepoCard });
if (three === undefined) {
tableItem3 = `[Add your theme][add-theme]`;
}
rows.push(`| ${tableItem1} | ${tableItem2} | ${tableItem3} |`);
// if it's the last row & the row has no empty space push a new row
if (three && i + 3 === themesFiltered.length) {
rows.push(`| [Add your theme][add-theme] | | |`);
}
}
return rows.join("\n");
+4
View File
@@ -68,6 +68,7 @@
"C": "#555555",
"C#": "#178600",
"C++": "#f34b7d",
"C3": "#2563eb",
"CAP CDS": "#0092d1",
"CLIPS": "#00A300",
"CMake": "#DA3434",
@@ -106,6 +107,7 @@
"Common Lisp": "#3fb68b",
"Common Workflow Language": "#B5314C",
"Component Pascal": "#B0CE4E",
"Cooklang": "#E15A29",
"Crystal": "#000100",
"Csound": "#1a1a1a",
"Csound Document": "#1a1a1a",
@@ -445,6 +447,7 @@
"QML": "#44a51c",
"Qt Script": "#00b841",
"Quake": "#882233",
"QuakeC": "#975777",
"QuickBASIC": "#008080",
"R": "#198CE7",
"RAML": "#77d9fb",
@@ -453,6 +456,7 @@
"REXX": "#d90e09",
"RMarkdown": "#198ce7",
"RON": "#a62c00",
"ROS Interface": "#22314e",
"RPGLE": "#2BDE21",
"RUNOFF": "#665a4e",
"Racket": "#3c5caa",
+25 -34
View File
@@ -458,42 +458,33 @@ const noop = () => {};
const logger =
process.env.NODE_ENV === "test" ? { log: noop, error: noop } : console;
const ONE_MINUTE = 60;
const FIVE_MINUTES = 300;
const TEN_MINUTES = 600;
const FIFTEEN_MINUTES = 900;
const THIRTY_MINUTES = 1800;
const TWO_HOURS = 7200;
const FOUR_HOURS = 14400;
const SIX_HOURS = 21600;
const EIGHT_HOURS = 28800;
const TEN_HOURS = 36000;
const TWELVE_HOURS = 43200;
const ONE_DAY = 86400;
const TWO_DAY = ONE_DAY * 2;
const SIX_DAY = ONE_DAY * 6;
const TEN_DAY = ONE_DAY * 10;
const MIN = 60;
const HOUR = 60 * MIN;
const DAY = 24 * HOUR;
const CONSTANTS = {
ONE_MINUTE,
FIVE_MINUTES,
TEN_MINUTES,
FIFTEEN_MINUTES,
THIRTY_MINUTES,
TWO_HOURS,
FOUR_HOURS,
SIX_HOURS,
EIGHT_HOURS,
TEN_HOURS,
TWELVE_HOURS,
ONE_DAY,
TWO_DAY,
SIX_DAY,
TEN_DAY,
CARD_CACHE_SECONDS: TEN_HOURS,
TOP_LANGS_CACHE_SECONDS: TEN_HOURS,
PIN_CARD_CACHE_SECONDS: TEN_HOURS,
ERROR_CACHE_SECONDS: TEN_MINUTES,
ONE_MINUTE: MIN,
FIVE_MINUTES: 5 * MIN,
TEN_MINUTES: 10 * MIN,
FIFTEEN_MINUTES: 15 * MIN,
THIRTY_MINUTES: 30 * MIN,
TWO_HOURS: 2 * HOUR,
FOUR_HOURS: 4 * HOUR,
SIX_HOURS: 6 * HOUR,
EIGHT_HOURS: 8 * HOUR,
TEN_HOURS: 10 * HOUR,
TWELVE_HOURS: 12 * HOUR,
ONE_DAY: DAY,
TWO_DAY: 2 * DAY,
SIX_DAY: 6 * DAY,
TEN_DAY: 10 * DAY,
CARD_CACHE_SECONDS: 10 * HOUR,
TOP_LANGS_CACHE_SECONDS: 10 * HOUR,
PIN_CARD_CACHE_SECONDS: 10 * HOUR,
ERROR_CACHE_SECONDS: 10 * MIN,
};
/**
+4 -9
View File
@@ -12,7 +12,7 @@ Use `?theme=THEME_NAME` parameter like so:
## Stats
> These themes works with all five our cards: Stats Card, Repo Card, Gist Card, Top languages Card and WakaTime Card.
> These themes work with all five of our cards: Stats Card, Repo Card, Gist Card, Top Languages Card, and WakaTime Card.
| | | |
| :--: | :--: | :--: |
@@ -40,11 +40,11 @@ Use `?theme=THEME_NAME` parameter like so:
| `rose_pine` ![rose_pine][rose_pine] | `catppuccin_latte` ![catppuccin_latte][catppuccin_latte] | `catppuccin_mocha` ![catppuccin_mocha][catppuccin_mocha] |
| `date_night` ![date_night][date_night] | `one_dark_pro` ![one_dark_pro][one_dark_pro] | `rose` ![rose][rose] |
| `holi` ![holi][holi] | `neon` ![neon][neon] | `blue_navy` ![blue_navy][blue_navy] |
| `calm_pink` ![calm_pink][calm_pink] | `ambient_gradient` ![ambient_gradient][ambient_gradient] | [Add your theme][add-theme] |
| `calm_pink` ![calm_pink][calm_pink] | `ambient_gradient` ![ambient_gradient][ambient_gradient] | |
## Repo Card
> These themes works with all five our cards: Stats Card, Repo Card, Gist Card, Top languages Card and WakaTime Card.
> These themes work with all five of our cards: Stats Card, Repo Card, Gist Card, Top Languages Card, and WakaTime Card.
| | | |
| :--: | :--: | :--: |
@@ -72,7 +72,7 @@ Use `?theme=THEME_NAME` parameter like so:
| `rose_pine` ![rose_pine][rose_pine_repo] | `catppuccin_latte` ![catppuccin_latte][catppuccin_latte_repo] | `catppuccin_mocha` ![catppuccin_mocha][catppuccin_mocha_repo] |
| `date_night` ![date_night][date_night_repo] | `one_dark_pro` ![one_dark_pro][one_dark_pro_repo] | `rose` ![rose][rose_repo] |
| `holi` ![holi][holi_repo] | `neon` ![neon][neon_repo] | `blue_navy` ![blue_navy][blue_navy_repo] |
| `calm_pink` ![calm_pink][calm_pink_repo] | `ambient_gradient` ![ambient_gradient][ambient_gradient_repo] | [Add your theme][add-theme] |
| `calm_pink` ![calm_pink][calm_pink_repo] | `ambient_gradient` ![ambient_gradient][ambient_gradient_repo] | |
[default]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=default
@@ -227,8 +227,3 @@ Use `?theme=THEME_NAME` parameter like so:
[blue_navy_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=blue_navy
[calm_pink_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=calm_pink
[ambient_gradient_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=ambient_gradient
[add-theme]: https://github.com/anuraghazra/github-readme-stats/edit/master/themes/index.js
Want to add a new theme? Consider reading the [contribution guidelines](../CONTRIBUTING.md#themes-contribution) :D