Compare commits

..
Author SHA1 Message Date
rickstaa 450d095fe4 feat: increase langs_count to 100 2022-10-03 11:49:14 +02:00
Ayushi Vishwakarmaandrickstaa 9e1fc0b7da update default values in readme (#2094)
* update default values in readme

* docs: improve formatting

* docs: improve readme punctation

Co-authored-by: rickstaa <rick.staa@outlook.com>
2022-10-03 09:14:37 +02:00
Manan1612 aa084f31c4 Added Contributors Badge (#2096) 2022-10-03 08:42:32 +02:00
rickstaa c5bea57638 docs: fix india care logo 2022-10-02 18:07:43 +02:00
rickstaa c2c984a872 docs: format readme 2022-10-02 17:58:34 +02:00
ianbromwichuos 2faf9c54ff docs: fix link to go India logo svg (#2085) 2022-10-02 17:47:14 +02:00
5 changed files with 102 additions and 159 deletions
+27 -28
View File
@@ -7,6 +7,9 @@
<a href="https://github.com/anuraghazra/github-readme-stats/actions"> <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" /> <img alt="Tests Passing" src="https://github.com/anuraghazra/github-readme-stats/workflows/Test/badge.svg" />
</a> </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"> <a href="https://codecov.io/gh/anuraghazra/github-readme-stats">
<img src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" /> <img src="https://codecov.io/gh/anuraghazra/github-readme-stats/branch/master/graph/badge.svg" />
</a> </a>
@@ -61,10 +64,9 @@
</p> </p>
<p align="center">Love the project? Please consider <a href="https://www.paypal.me/anuraghazra">donating</a> to help it improve! <p align="center">Love the project? Please consider <a href="https://www.paypal.me/anuraghazra">donating</a> to help it improve!
<p> <p>
<a href="https://indiafightscorona.giveindia.org"> <a href="https://indiafightscorona.giveindia.org">
<img src="https://d2wvdrxmr8p0wf.cloudfront.net/static/giveindia.svg" alt="Give india logo" width="200" /> <img src="https://indiaspora.org/wp-content/uploads/2021/04/give-India-logo.png" alt="Give india logo" width="200" />
</a> </a>
Are you considering supporting the project by donating? Please DON'T!! Are you considering supporting the project by donating? Please DON'T!!
@@ -72,10 +74,10 @@ Are you considering supporting the project by donating? Please DON'T!!
Instead, Help India fight the 2nd deadly wave of COVID-19. Instead, Help India fight the 2nd deadly wave of COVID-19.
Thousands of people are dying in India because of a lack of Oxygen & also COVID-related infrastructure. Thousands of people are dying in India because of a lack of Oxygen & also COVID-related infrastructure.
Visit [https://indiafightscorona.giveindia.org](https://indiafightscorona.giveindia.org) and make a small donation to help us fight COVID and overcome this crisis. Visit <https://indiafightscorona.giveindia.org> and make a small donation to help us fight COVID and overcome this crisis.
A small donation goes a long way. :heart: A small donation goes a long way. :heart:
</p>
</p>
# Features # Features
@@ -177,9 +179,7 @@ You can customize the appearance of your `Stats Card` or `Repo Card` however you
You can provide multiple comma-separated values in the bg_color option to render a gradient, with the following format: You can provide multiple comma-separated values in the bg_color option to render a gradient, with the following format:
```
&bg_color=DEG,COLOR1,COLOR2,COLOR3...COLOR10 &bg_color=DEG,COLOR1,COLOR2,COLOR3...COLOR10
```
> Note on cache: Repo cards have a default cache of 4 hours (14400 seconds) if the fork count & star count is less than 1k, otherwise, it's 2 hours (7200 seconds). Also, note that the cache is clamped to a minimum of 2 hours and a maximum of 24 hours. > Note on cache: Repo cards have a default cache of 4 hours (14400 seconds) if the fork count & star count is less than 1k, otherwise, it's 2 hours (7200 seconds). Also, note that the cache is clamped to a minimum of 2 hours and a maximum of 24 hours.
@@ -199,16 +199,16 @@ You can provide multiple comma-separated values in the bg_color option to render
- `disable_animations` - Disables all animations in the card _(boolean)_. Default: `false`. - `disable_animations` - Disables all animations in the card _(boolean)_. Default: `false`.
> Note on `hide_rank`: > Note on `hide_rank`:
When hide_rank=`true`, the minimum card width is 270 px + the title length and padding. > When hide_rank=`true`, the minimum card width is 270 px + the title length and padding.
#### Repo Card Exclusive Options: #### Repo Card Exclusive Options:
- `show_owner` - Show the repo's owner name _(boolean)_ - `show_owner` - Show the repo's owner name _(boolean)_. Defaults to `false`.
#### Language Card Exclusive Options: #### Language Card Exclusive Options:
- `hide` - Hide the languages specified from the card _(Comma-separated values)_ - `hide` - Hide the languages specified from the card _(Comma-separated values)_
- `hide_title` - _(boolean)_ - `hide_title` - _(boolean)_. Defaults to `false`.
- `layout` - Switch between two available layouts `default` & `compact` - `layout` - Switch between two available layouts `default` & `compact`
- `card_width` - Set the card's width manually _(number)_ - `card_width` - Set the card's width manually _(number)_
- `langs_count` - Show more languages on the card, between 1-10, defaults to 5 _(number)_ - `langs_count` - Show more languages on the card, between 1-10, defaults to 5 _(number)_
@@ -223,8 +223,8 @@ When hide_rank=`true`, the minimum card width is 270 px + the title length and p
#### Wakatime Card Exclusive Options: #### Wakatime Card Exclusive Options:
- `hide` - Hide the languages specified from the card _(Comma-separated values)_ - `hide` - Hide the languages specified from the card _(Comma-separated values)_
- `hide_title` - _(boolean)_ - `hide_title` - _(boolean)_. Defaults to `false`.
- `line_height` - Sets the line-height between text _(number)_ - `line_height` - Sets the line-height between text _(number)_. Default Value: `25`.
- `hide_progress` - Hides the progress bar and percentage _(boolean)_ - `hide_progress` - Hides the progress bar and percentage _(boolean)_
- `custom_title` - Sets a custom title for the card - `custom_title` - Sets a custom title for the card
- `layout` - Switch between two available layouts `default` & `compact` - `layout` - Switch between two available layouts `default` & `compact`
@@ -232,7 +232,7 @@ When hide_rank=`true`, the minimum card width is 270 px + the title length and p
- `api_domain` - Set 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) - `api_domain` - Set 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)
- `range` Request a range different from your WakaTime default, e.g. `last_7_days`. See [WakaTime API docs](https://wakatime.com/developers#stats) for a list of available options. - `range` Request a range different from your WakaTime default, e.g. `last_7_days`. See [WakaTime API docs](https://wakatime.com/developers#stats) for a list of available options.
--- * * *
# GitHub Extra Pins # GitHub Extra Pins
@@ -334,7 +334,7 @@ Change the `?username=` value to your [Wakatime](https://wakatime.com) username.
[![willianrod's wakatime stats](https://github-readme-stats.vercel.app/api/wakatime?username=willianrod&layout=compact)](https://github.com/anuraghazra/github-readme-stats) [![willianrod's wakatime stats](https://github-readme-stats.vercel.app/api/wakatime?username=willianrod&layout=compact)](https://github.com/anuraghazra/github-readme-stats)
--- * * *
### All Demos ### All Demos
@@ -388,7 +388,7 @@ Choose from any of the [default themes](#themes)
[![willianrod's wakatime stats](https://github-readme-stats.vercel.app/api/wakatime?username=willianrod)](https://github.com/anuraghazra/github-readme-stats) [![willianrod's wakatime stats](https://github-readme-stats.vercel.app/api/wakatime?username=willianrod)](https://github.com/anuraghazra/github-readme-stats)
--- * * *
### Quick Tip (Align The Repo Cards) ### Quick Tip (Align The Repo Cards)
@@ -417,22 +417,22 @@ NOTE: Since [#58](https://github.com/anuraghazra/github-readme-stats/pull/58) we
<summary><b> Guide on setting up Vercel 🔨 </b></summary> <summary><b> Guide on setting up Vercel 🔨 </b></summary>
1. Go to [vercel.com](https://vercel.com/) 1. Go to [vercel.com](https://vercel.com/)
1. Click on `Log in` 2. Click on `Log in`
![](https://files.catbox.moe/tct1wg.png) ![](https://files.catbox.moe/tct1wg.png)
1. Sign in with GitHub by pressing `Continue with GitHub` 3. Sign in with GitHub by pressing `Continue with GitHub`
![](https://files.catbox.moe/btd78j.jpeg) ![](https://files.catbox.moe/btd78j.jpeg)
1. Sign in to GitHub and allow access to all repositories, if prompted 4. Sign in to GitHub and allow access to all repositories, if prompted
1. Fork this repo 5. Fork this repo
1. After forking the repo, open the [`vercel.json`](https://github.com/anuraghazra/github-readme-stats/blob/master/vercel.json#L5) file and change the `maxDuration` field to `10` 6. After forking the repo, open the [`vercel.json`](https://github.com/anuraghazra/github-readme-stats/blob/master/vercel.json#L5) file and change the `maxDuration` field to `10`
1. Go back to your [Vercel dashboard](https://vercel.com/dashboard) 7. Go back to your [Vercel dashboard](https://vercel.com/dashboard)
1. Select `Import Project` 8. Select `Import Project`
![](https://files.catbox.moe/qckos0.png) ![](https://files.catbox.moe/qckos0.png)
1. Select `Import Git Repository`. Select root and keep everything as is. 9. Select `Import Git Repository`. Select root and keep everything as is.
![](https://files.catbox.moe/pqub9q.png) ![](https://files.catbox.moe/pqub9q.png)
1. Create a personal access token (PAT) [here](https://github.com/settings/tokens/new) and enable the `repo` permissions (this allows access to see private repo stats) 10. Create a personal access token (PAT) [here](https://github.com/settings/tokens/new) and enable the `repo` permissions (this allows access to see private repo stats)
1. Add the PAT as an environment variable named `PAT_1` (as shown). 11. Add the PAT as an environment variable named `PAT_1` (as shown).
![](https://files.catbox.moe/0ez4g7.png) ![](https://files.catbox.moe/0ez4g7.png)
1. Click deploy, and you're good to go. See your domains to use the API! 12. Click deploy, and you're good to go. See your domains to use the API!
</details> </details>
@@ -449,11 +449,10 @@ However, if you are using this project and are happy with it or just want to enc
Thanks! :heart: Thanks! :heart:
--- * * *
[![https://vercel.com?utm_source=github_readme_stats_team&utm_campaign=oss](./powered-by-vercel.svg)](https://vercel.com?utm_source=github_readme_stats_team&utm_campaign=oss) [![https://vercel.com?utm_source=github_readme_stats_team&utm_campaign=oss](./powered-by-vercel.svg)](https://vercel.com?utm_source=github_readme_stats_team&utm_campaign=oss)
Contributions are welcome! &lt;3
Contributions are welcome! <3
Made with :heart: and JavaScript. Made with :heart: and JavaScript.
-2
View File
@@ -562,6 +562,4 @@ export const run = async (prNumber) => {
} }
}; };
if (typeof require !== "undefined" && require.main === module) {
run(); run();
}
-54
View File
@@ -1,54 +0,0 @@
/**
* @file Apply preview-theme script to all theme pull requests.
*/
import { debug, setFailed } from "@actions/core";
import { getGithubToken, getRepoInfo } from "./helpers.js";
import { run as previewTheme } from "./preview-theme.js";
import github from "@actions/github";
import { fetchOpenPRs, pullsWithLabel } from "./close-stale-theme-prs.js";
/**
* Get all pull request that do not contain a given label.
* @param pull The pull requests to check.
* @param label The label to check for.
* @returns Whether the pull request contains the label.
*/
export const pullsWithoutLabel = (pulls, label) => {
return pulls.filter((pr) => {
return pr.labels.nodes.some((lab) => lab.name !== label);
});
};
/**
* Main function.
*/
const run = async () => {
try {
// Create octokit client.
const dryRun = process.env.DRY_RUN === "true" || false;
debug("Creating octokit client...");
const octokit = github.getOctokit(getGithubToken());
const { owner, repo } = getRepoInfo(github.context);
// Retrieve all theme pull requests.
debug("Retrieving all theme pull requests...");
const prs = await fetchOpenPRs(octokit, owner, repo);
let themePRs = pullsWithLabel(prs, "themes");
themePRs = pullsWithoutLabel(themePRs, "invalid");
debug(`Found ${themePRs.length} theme PRs`);
// Loop through all theme PR and execute the theme-preview script.
for (const pr of themePRs) {
debug(`Applying theme-preview to #${pr.number}...`);
console.log("Pull request number: ", pr.number);
if (!dryRun) {
await previewTheme(pr.number);
}
}
} catch (error) {
setFailed(error.message);
}
};
run();
+1 -1
View File
@@ -88,7 +88,7 @@ const renderRepoCard = (repo, options = {}) => {
icon_color, icon_color,
text_color, text_color,
bg_color, bg_color,
show_owner, show_owner = false,
theme = "default_repocard", theme = "default_repocard",
border_radius, border_radius,
border_color, border_color,
+2 -2
View File
@@ -205,7 +205,7 @@ const calculateNormalLayoutHeight = (totalLangs) => {
const useLanguages = (topLangs, hide, langs_count) => { const useLanguages = (topLangs, hide, langs_count) => {
let langs = Object.values(topLangs); let langs = Object.values(topLangs);
let langsToHide = {}; let langsToHide = {};
let langsCount = clampValue(parseInt(langs_count), 1, 10); let langsCount = clampValue(parseInt(langs_count), 1, 100);
// populate langsToHide map for quick lookup // populate langsToHide map for quick lookup
// while filtering out // while filtering out
@@ -235,7 +235,7 @@ const useLanguages = (topLangs, hide, langs_count) => {
*/ */
const renderTopLanguages = (topLangs, options = {}) => { const renderTopLanguages = (topLangs, options = {}) => {
const { const {
hide_title, hide_title = false,
hide_border, hide_border,
card_width, card_width,
title_color, title_color,