mirror of
https://github.com/Aviortheking/codestats-readme.git
synced 2025-04-22 10:42:08 +00:00
fix: readme generate script 'Add new theme' table item
This commit is contained in:
parent
f0a0dfe51c
commit
ef57cc7dcf
@ -40,6 +40,8 @@ ${REPO_CARD_LINKS_FLAG}
|
|||||||
|
|
||||||
${STAT_CARD_LINKS_FLAG}
|
${STAT_CARD_LINKS_FLAG}
|
||||||
|
|
||||||
|
[add-theme]: https://github.com/anuraghazra/github-readme-stats/edit/master/themes/index.js
|
||||||
|
|
||||||
Wanted to add a new theme? Consider reading the [contribution guidelines](../CONTRIBUTING.md#themes-contribution) :D
|
Wanted to add a new theme? Consider reading the [contribution guidelines](../CONTRIBUTING.md#themes-contribution) :D
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@ -56,6 +58,9 @@ const generateLinks = (fn) => {
|
|||||||
.join("");
|
.join("");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const createTableItem = ({ link, label }) => {
|
||||||
|
return `\`${label}\` ![${link}][${link}]`;
|
||||||
|
};
|
||||||
const generateTable = ({ isRepoCard }) => {
|
const generateTable = ({ isRepoCard }) => {
|
||||||
const rows = [];
|
const rows = [];
|
||||||
const themes = Object.keys(theme).filter(
|
const themes = Object.keys(theme).filter(
|
||||||
@ -66,9 +71,15 @@ const generateTable = ({ isRepoCard }) => {
|
|||||||
const one = themes[i];
|
const one = themes[i];
|
||||||
const two = themes[i + 1];
|
const two = themes[i + 1];
|
||||||
const three = themes[i + 2];
|
const three = themes[i + 2];
|
||||||
rows.push(
|
|
||||||
`| \`${one}\` ![${one}][${one}] | \`${two}\` ![${two}][${two}] | \`${three}\` ![${three}][${three}] |`
|
let tableItem1 = createTableItem({ link: one, label: one });
|
||||||
);
|
let tableItem2 = createTableItem({ link: two, label: two });
|
||||||
|
let tableItem3 = createTableItem({ link: one, label: one });
|
||||||
|
|
||||||
|
if (three === undefined) {
|
||||||
|
tableItem3 = `[Add your theme][add-theme]`;
|
||||||
|
}
|
||||||
|
rows.push(`| ${tableItem1} | ${tableItem2} | ${tableItem3} |`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return rows.join("\n");
|
return rows.join("\n");
|
||||||
|
@ -16,12 +16,12 @@ Use `?theme=THEME_NAME` parameter like so :-
|
|||||||
|
|
||||||
| | | |
|
| | | |
|
||||||
| :--: | :--: | :--: |
|
| :--: | :--: | :--: |
|
||||||
| `default` ![default][default] | `dark` ![dark][dark] | `radical` ![radical][radical] |
|
| `default` ![default][default] | `dark` ![dark][dark] | `default` ![default][default] |
|
||||||
| `merko` ![merko][merko] | `gruvbox` ![gruvbox][gruvbox] | `tokyonight` ![tokyonight][tokyonight] |
|
| `merko` ![merko][merko] | `gruvbox` ![gruvbox][gruvbox] | `merko` ![merko][merko] |
|
||||||
| `onedark` ![onedark][onedark] | `cobalt` ![cobalt][cobalt] | `synthwave` ![synthwave][synthwave] |
|
| `onedark` ![onedark][onedark] | `cobalt` ![cobalt][cobalt] | `onedark` ![onedark][onedark] |
|
||||||
| `highcontrast` ![highcontrast][highcontrast] | `dracula` ![dracula][dracula] | `prussian` ![prussian][prussian] |
|
| `highcontrast` ![highcontrast][highcontrast] | `dracula` ![dracula][dracula] | `highcontrast` ![highcontrast][highcontrast] |
|
||||||
| `monokai` ![monokai][monokai] | `vue` ![vue][vue] | `shades-of-purple` ![shades-of-purple][shades-of-purple] |
|
| `monokai` ![monokai][monokai] | `vue` ![vue][vue] | `monokai` ![monokai][monokai] |
|
||||||
| `nightowl` ![nightowl][nightowl] | `buefy` ![buefy][buefy] | `undefined` ![undefined][undefined] |
|
| `nightowl` ![nightowl][nightowl] | `buefy` ![buefy][buefy] | [Add your theme][add-theme] |
|
||||||
|
|
||||||
## Repo Card
|
## Repo Card
|
||||||
|
|
||||||
@ -29,12 +29,12 @@ Use `?theme=THEME_NAME` parameter like so :-
|
|||||||
|
|
||||||
| | | |
|
| | | |
|
||||||
| :--: | :--: | :--: |
|
| :--: | :--: | :--: |
|
||||||
| `default_repocard` ![default_repocard][default_repocard] | `dark` ![dark][dark] | `radical` ![radical][radical] |
|
| `default_repocard` ![default_repocard][default_repocard] | `dark` ![dark][dark] | `default_repocard` ![default_repocard][default_repocard] |
|
||||||
| `merko` ![merko][merko] | `gruvbox` ![gruvbox][gruvbox] | `tokyonight` ![tokyonight][tokyonight] |
|
| `merko` ![merko][merko] | `gruvbox` ![gruvbox][gruvbox] | `merko` ![merko][merko] |
|
||||||
| `onedark` ![onedark][onedark] | `cobalt` ![cobalt][cobalt] | `synthwave` ![synthwave][synthwave] |
|
| `onedark` ![onedark][onedark] | `cobalt` ![cobalt][cobalt] | `onedark` ![onedark][onedark] |
|
||||||
| `highcontrast` ![highcontrast][highcontrast] | `dracula` ![dracula][dracula] | `prussian` ![prussian][prussian] |
|
| `highcontrast` ![highcontrast][highcontrast] | `dracula` ![dracula][dracula] | `highcontrast` ![highcontrast][highcontrast] |
|
||||||
| `monokai` ![monokai][monokai] | `vue` ![vue][vue] | `shades-of-purple` ![shades-of-purple][shades-of-purple] |
|
| `monokai` ![monokai][monokai] | `vue` ![vue][vue] | `monokai` ![monokai][monokai] |
|
||||||
| `nightowl` ![nightowl][nightowl] | `buefy` ![buefy][buefy] | `undefined` ![undefined][undefined] |
|
| `nightowl` ![nightowl][nightowl] | `buefy` ![buefy][buefy] | [Add your theme][add-theme] |
|
||||||
|
|
||||||
|
|
||||||
[default]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=default
|
[default]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=default
|
||||||
@ -76,4 +76,6 @@ Use `?theme=THEME_NAME` parameter like so :-
|
|||||||
[nightowl]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=nightowl
|
[nightowl]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=nightowl
|
||||||
[buefy]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=buefy
|
[buefy]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=buefy
|
||||||
|
|
||||||
|
[add-theme]: https://github.com/anuraghazra/github-readme-stats/edit/master/themes/index.js
|
||||||
|
|
||||||
Wanted to add a new theme? Consider reading the [contribution guidelines](../CONTRIBUTING.md#themes-contribution) :D
|
Wanted to add a new theme? Consider reading the [contribution guidelines](../CONTRIBUTING.md#themes-contribution) :D
|
||||||
|
Loading…
x
Reference in New Issue
Block a user