Du magst das Projekt? Wie wäre es mit einer kleinen Spende um es weiterhin am Leben zu erhalten?
-
-# Funktionen
-
-- [GitHub Statistiken-Karte](#github-statistiken-karte)
- - [Verbergen individueller Statistiken](#verbergen-individueller-statistiken)
- - [Symbole anzeigen](#symbole-anzeigen)
- - [Erscheinungsbild/Themes](#erscheinungsbildthemes)
- - [Anpassungen/Personalisierung](#anpassungenpersonalisierung)
-- [GitHub Extra-Pins](#github-extra-pins)
- - [Benutzung](#benutzung)
- - [Beispiele](#beispiele)
-- [Top Programmiersprachen-Karte](#top-programmiersprachen-karte)
- - [Benutzung](#benutzung-1)
- - [Verbirg einzelne Sprachen](#verbirg-einzelne-sprachen)
- - [Kompaktes Sprachen-Karte Layout](#kompaktes-sprachen-karte-layout)
- - [Beispiel](#beispiel)
-- [WakaTime Wochen-Statistik](#wakatime-wochen-statistik)
- - [Beispiel](#beispiel-1)
- - [Alle Beispiele](#alle-beispiele)
- - [Kleiner Tipp (Ausrichten der Repo-Karte)](#kleiner-tipp-ausrichten-der-repo-karte)
- - [Betreibe es auf deiner eigenen Vercel-Instanz](#betreibe-es-auf-deiner-eigenen-vercel-instanz)
- - [:sparkling\_heart: Unterstütze das Projekt](#sparkling_heart-unterstütze-das-projekt)
-
-# GitHub Statistiken-Karte
-
-Kopiere folgendes in deine Readme um die Statistiken zu benutzen.
-Passe den Wert des URL-Parameters `?username=` so an, dass dort dein GitHub-Nutzername steht.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-_Hinweis: Die Berechnung des Ranges basiert auf den jeweiligen Benutzerstatistiken, siehe [src/calculateRank.js](../src/calculateRank.js)_
-
-### Verbergen individueller Statistiken
-
-Um eine spezifische Statistik auszublenden, kann dem Query-Parameter `?hide=` ein Array an Optionen, die nicht angezeigt werden sollen, übergeben werden.
-
-> Optionen: `&hide=stars,commits,prs,issues,contribs`
-
-```md
-
-```
-
-### Symbole anzeigen
-
-Um Symbole anzuzeigen kann der URL-Parameter `show_icons=true` wie folgt verwendet werden:
-
-```md
-
-```
-
-### Erscheinungsbild/Themes
-
-Mithilfe der eingebauten Themes kann das Aussehen der Karten verändern werden, ohne manuelle Anpassungen vornehmen zu müssen.
-
-Benutze den `?theme=THEME_NAME`-Parameter wie folgt :-
-
-```md
-
-```
-
-#### Alle eingebauten Themes :-
-
-dark, radical, merko, gruvbox, tokyonight, onedark, cobalt, synthwave, highcontrast, dracula
-
-
-
-Du kannst dir eine Vorschau [aller verfügbaren Themes](../themes/README.md) ansehen oder die [theme config Datei](../themes/index.js) ansehen.
-Außerdem **kannst du neue Themes erstellen**, Beiträge an diesem Projekt sind gerne gesehen! :D
-
-### Anpassungen/Personalisierung
-
-Du kannst das Erscheinungsbild deiner `Stats Card` oder `Repo Card`, mithilfe von URL-Parametern, nach deinen Vorlieben anpassen.
-
-#### Verbreitete Optionen:
-
-- `title_color` - Titelfarbe _(hex color)_
-- `text_color` - Textkörperfarbe _(hex color)_
-- `icon_color` - Symbolfarbe (falls verfügbar) _(hex color)_
-- `bg_color` - Hintergrundfarbe _(hex color)_ **oder** ein Farbverlauf in der Form von _winkel,start,ende_
-- `hide_border` - Blendet den Rand der Karte aus _(Boolean)_
-- `theme` - Name des Erscheinungsbildes/Themes [alle verfügbaren Themes](../themes/README.md)
-- `cache_seconds` - manuelles festlegen der Cachezeiten _(min: 14400, max: 86400)_
-- `locale` - Stellen Sie die Sprache auf der Karte ein _(z.B. cn, de, es, etc.)_
-
-##### Farbverlauf in bg_color
-
-Du kannst mehrere, mit Kommas separierte, Werte in der bg_color Option angeben, um einen Farbverlauf anzuzeigen. Das Format ist:-
-
-```
-&bg_color=WINKEL,FARBE1,FARBE2,FARBE3...FARBE10
-```
-
-> Hinweis bzgl. des Caches: Wenn die Anzahl der Forks und Stars geringer als 1 Tsd. ist, haben die Repo-Cards eine Standard-Cachezeit von 30 Minuten (1800 Sekunden), ansonsten beträgt diese 2 Stunden (7200 Sekunden). Außerdem ist der Cache auf ein Minimum von 30 Minuten und ein Maximum von 24 Stunden begrenzt.
-
-#### Exklusive Optionen der Statistiken-Karte:
-
-- `hide` - Verbirgt die [angegeben Elemente](#verbergen-individueller-statistiken) _(mit Komma abgegrenzte Werte)_
-- `hide_title` - _(Boolean)_
-- `hide_rank` - _(Boolean)_
-- `show_icons` - _(Boolean)_
-- `include_all_commits` - Zähle alle Beiträge anstatt nur das aktuelle Jahr _(Boolean)_
-- `count_private` - Zähle private Beiträge _(Boolean)_
-- `line_height` - Legt die Zeilenhöhe zwischen Text fest _(Zahl)_
-
-#### Exklusive Optionen der Repo-Karte:
-
-- `show_owner` - Zeigt den Besitzer des Repos _(Boolean)_
-
-#### Exklusive Optionen der Sprachen-Karte:
-
-- `hide` - Verbirgt die angegebenen Sprachen von der Karte _(Komma separierte Werte)_
-- `hide_title` - _(Boolean)_
-- `layout` - Wechseln Sie zwischen den fünf verfügbaren Layouts `normal` & `compact` & `donut` & `donut-vertical` & `pie`
-- `card_width` - Lege die Breite der Karte manuell fest _(Zahl)_
-
-> :warning: **Wichtig:**
-> Sprachennamen sollten uri-escaped sein, wie hier angegeben: [Percent Encoding](https://en.wikipedia.org/wiki/Percent-encoding)
-> (z.B.: `c++` sollte zu `c%2B%2B` werden, `jupyter notebook` sollte zu `jupyter%20notebook` werden, usw.)
-
-#### Exklusive Optionen der WakaTime-Karte:
-
-- `hide_title` - _(Boolean)_
-- `line_height` - Legt die Zeilenhöhe des Texts fest _(Zahl)_
-- `hide_progress` - Verbirgt die Fortschrittsanzeige und Prozentzahl _(Boolean)_
-- `custom_title` - Legt einen benutzerdefinierten Titel fest
-- `layout` - Wechselt zwischen zwei verschiedenen Layouts: `default` & `compact`
-- `langs_count` - Begrenzt die Anzahl der angezeigten Sprachen auf der Karte
-- `api_domain` - Legt eine benutzerdefinierte API Domain fest, z.B. für [Hakatime](https://github.com/mujx/hakatime) oder [Wakapi](https://github.com/muety/wakapi)
-- `range` – Fragt eine andere Zeitspanne an, als jene, welche standardmäßig in WakaTime hinterlegt ist. Zum Beispiel `last_7_days`. Siehe [WakaTime API Dokumentation](https://wakatime.com/developers#stats).
-
----
-
-# GitHub Extra-Pins
-
-GitHub Extra-Pins ermöglicht es mit Hilfe einer Readme auf deinem Profil mehr als 6 Repositories anzuzeigen.
-
-Und Bääm! Du bist nicht mehr auf 6 angeheftete Repositories limitiert.
-
-### Benutzung
-
-Füge diesen Code in deine Readme-Datei ein und passe die Links an.
-Passe den Wert des URL-Parameters `?username=` so an, dass dort dein GitHub-Nutzername steht.
-Den Wert des URL-Parameters `?repo=` musst du so anpassen, dass dort der Namen deines Repositorys steht.
-
-Endpunkt: `api/pin?username=anuraghazra&repo=github-readme-stats`
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Beispiele
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-Benutze die [show_owner](#anpassungenpersonalisierung) Variable, um den Nutzernamen des Repository-Eigentümers anzuzeigen.
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-# Top Programmiersprachen-Karte
-
-Die Top Programmiersprachen-Karte visualisiert die am meisten benutzten Programmiersprachen eines GitHub-Nutzers.
-
-_HINWEIS: Die Top Programmiersprachen treffen keine Aussage über persönliche Fähigkeiten oder dergleichen, es ist lediglich eine auf den GitHub-Statistiken des Nutzers basierende Kennzahl, welche Programmiersprache wie häufig verwendet wurde._
-
-### Benutzung
-
-Füge diesen Code in deine Readme-Datei ein und passe die Links an.
-Passe den Wert des URL-Parameters `?username=` so an, dass dort dein GitHub-Nutzername steht.
-
-Endpunkt: `api/top-langs?username=anuraghazra`
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Verbirg einzelne Sprachen
-
-Du kannst den `?hide=language1,language2` URL-Parameter benutzen, um einzelne Sprachen auszublenden.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Kompaktes Sprachen-Karte Layout
-
-Du kannst die `&layout=compact` Option nutzen, um das Kartendesign zu ändern.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Beispiel
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-- Kompaktes Layout
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-# WakaTime Wochen-Statistik
-
-Ändere `?username=` in den eigenen [WakaTime](https://wakatime.com)-Benutzernamen.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Beispiel
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-- Kompaktes Layout
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
----
-
-### Alle Beispiele
-
-- Default
-
-
-
-- Ausblenden bestimmter Statistiken
-
-
-
-- Symbole anzeigen
-
-
-
-- Alle Beiträge anzeigen
-
-
-
-- Erscheinungsbild/Themes
-
-Wähle Eines von den [Standard-Themes](#themes)
-
-
-
-- Farbverlauf
-
-
-
-- Statistiken-Karte anpassen
-
-
-
-- Repo-Karte(Extra-Pin) anpassen
-
-
-
-- Top Programmiersprachen
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
----
-
-### Kleiner Tipp (Ausrichten der Repo-Karte)
-
-Üblicherweise ist es in `.md`-Dateien nicht möglich Bilder nebeneinander anzuzeigen. Um dies zu ermöglichen, kannst du folgendes tun:
-
-```html
-
-
-
-
-
-
-```
-
-## Betreibe es auf deiner eigenen Vercel-Instanz
-
-#### [Schritt für Schritt YouTube Tutorial by @codeSTACKr](https://youtu.be/n6d4KHSKqGk?t=107)
-
-Da die GitHub API nur 5 Tsd. Aufrufe pro Stunde zulässt, kann es passieren, dass meine `https://github-readme-stats.vercel.app/api` dieses Limit erreicht.
-Wenn du es auf deinem eigenen Vercel-Server hostest, brauchst du dich darum nicht zu kümmern. Klicke auf den Deploy-Knopf um loszulegen!
-
-Hinweis: Seit [#58](https://github.com/anuraghazra/github-readme-stats/pull/58) sollte es möglich sein, mehr als 5 Tsd Aufrufe pro Stunde ohne Downtimes zu verkraften :D
-
-[](https://vercel.com/import/project?template=https://github.com/anuraghazra/github-readme-stats)
-
-
- Anleitung zum Einrichten von Vercel 🔨
-
-1. Gehe zu [vercel.com](https://vercel.com/)
-1. Klicke auf `Log in`
- 
-1. Melde dich mit deinem GitHub-account an, indem du `Continue with GitHub` klickst
- 
-1. Verbinde dich mit GitHub und erlaube den Zugriff auf alle Repositories (falls gefordert)
-1. Forke dieses Repository
-1. Gehe zurück zu deinem [Vercel Dashboard](https://vercel.com/dashboard)
-1. Klick `Import Project`
- 
-1. Klick `Import Git Repository`
- 
-1. Wähle root und füge eine Umgebungsvariable namens PAT_1 (siehe Abbildung) die als Wert deinen persönlichen Access Token (PAT) hat hinzu, den du einfach [hier](https://github.com/settings/tokens/new) erzeugen kannst (lasse alles wie es ist, vergebe einen beliebigen Namen)
- 
-1. Klicke auf `Deploy`, und das wars. Besuche deine Domains um die API zu benutzen!
-
-
-## :sparkling_heart: Unterstütze das Projekt
-
-Ich versuche alles was ich kann als Open-Source zur Verfügung zu stellen, als auch jedem der Hilfe bei der Benutzung dieses Projektes braucht zu antworten. Natürlich beansprucht sowas Zeit und du kannst diesen Dienst kostenlos benutzen.
-
-Wenn du dieses Projekt nutzt und zufrieden bist, kannst du dennoch Dinge tun um mich weiterhin zu motivieren am Projekt zu arbeiten:
-
-- Erwähne und verlinke das Projekt in deiner Readme wenn du es benutzt :D
-- Geb dem Projekt einen Stern hier auf GitHub und teile es :rocket:
-- [](https://www.paypal.me/anuraghazra) - Du kannst einmalige Spenden via PayPal tätigen. Ich kaufe mir wahrscheinlich einen ~~Kaffee~~ Tee davon. :tea:
-
-Vielen Dank! :heart:
-
----
-
-[](https://vercel.com?utm_source=github_readme_stats_team&utm_campaign=oss)
-
-
-Mitarbeit an dem Projekt ist immer Willkommen! <3
-
-Gemacht mit viel :heart: und JavaScript.
diff --git a/docs/readme_es.md b/docs/readme_es.md
deleted file mode 100644
index 89f647f7e08c7..0000000000000
--- a/docs/readme_es.md
+++ /dev/null
@@ -1,427 +0,0 @@
-
-
-
GitHub Readme Stats
-
¡Obtén tus estadísticas de GitHub generadas dinámicamente en tu README!
¿Te gusta este proyecto? ¡Por favor, considera donar para ayudar a mejorarlo!
-
-# Características
-
-- [Tarjeta de estadísticas de GitHub](#tarjeta-de-estadísticas-de-github)
- - [Ocultar estadísticas individualmente](#ocultar-estadísticas-individualmente)
- - [Agregar contribuciones privadas al total de commits contados](#agregar-contribuciones-privadas-al-total-de-commits-contados)
- - [Mostrar íconos](#mostrar-íconos)
- - [Temas](#temas)
- - [Personalización](#personalización)
-- [Pines adicionales de GitHub](#pines-adicionales-de-github)
- - [Utilización](#utilización)
- - [Ejemplo](#ejemplo)
-- [Tarjeta de Lenguajes Principales](#tarjeta-de-lenguajes-principales)
- - [Utilización](#utilización-1)
- - [Excluir repositorios individualmente](#excluir-repositorios-individualmente)
- - [Ocultar lenguajes individualmente](#ocultar-lenguajes-individualmente)
- - [Mostrar más lenguajes](#mostrar-más-lenguajes)
- - [Diseño Compacto de Tarjeta de Lenguaje](#diseño-compacto-de-tarjeta-de-lenguaje)
- - [Ejemplo](#ejemplo-1)
-- [Estadísticas de la semana de WakaTime](#estadísticas-de-la-semana-de-wakatime)
- - [Ejemplo](#ejemplo-2)
- - [Todos los ejemplos](#todos-los-ejemplos)
- - [Consejo rápido (para alinear las tarjetas de repositorio)](#consejo-rápido-para-alinear-las-tarjetas-de-repositorio)
- - [Despliega tu propia instancia de Vercel](#despliega-tu-propia-instancia-de-vercel)
- - [:sparkling\_heart: Apoya al proyecto](#sparkling_heart-apoya-al-proyecto)
-
-# Tarjeta de estadísticas de GitHub
-
-Copia y pega esto en el contenido de tu README.md y listo. ¡Simple!
-
-Cambia el valor de `?username=` al nombre de tu usuario de GitHub.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-_Nota: Los rangos disponibles son S+ (top 1%), S (top 25%), A++ (top 45%), A+ (top 60%) y B+ (todos). Los valores se calculan utilizando la [función de distribución acumulada](https://es.wikipedia.org/wiki/Funci%C3%B3n_de_distribuci%C3%B3n) utilizando commits, contribuciones, issues, estrellas, pull request, seguidores y repositorios propios. Puedes investigar más sobre la implementación en [src/calculateRank.js](../src/calculateRank.js)._
-
-### Ocultar estadísticas individualmente
-
-Para ocultar alguna estadística específica, puedes utilizar el parámetro `?hide=` con los elementos que quieras ocultar separados por comas.
-
-> Opciones: `&hide=stars,commits,prs,issues,contribs`
-
-```md
-
-```
-
-### Agregar contribuciones privadas al total de commits contados
-
-Puedes agregar el recuento de todas sus contribuciones privadas al recuento total de commits utilizando el parámetro `?count_private=true`.
-
-_Nota: Si estás desplegando este proyecto tú mismo, las contribuciones privadas se contarán de manera predeterminada; de lo contrario, deberás elegir compartir el recuento de sus contribuciones privadas._
-
-> Opciones: `&count_private=true`
-
-```md
-
-```
-
-### Mostrar íconos
-
-Para habilitar los íconos, puedes utilizar `show_icons=true` como parámetro, de esta manera:
-
-```md
-
-```
-
-### Temas
-
-Puedes personalizar el aspecto de la tarjeta sin realizar ninguna [personalización manual](#personalización) con los temas incorporados.
-
-Utiliza el parámetro `?theme=THEME_NAME`, de esta manera:
-
-```md
-
-```
-
-#### Todos los temas incorporados
-
-dark, radical, merko, gruvbox, tokyonight, onedark, cobalt, synthwave, highcontrast, dracula
-
-
-
-Puedes ver una vista previa de [todos los temas disponibles](../themes/README.md) o ver el [archivo de configuración](../themes/index.js) del tema y también **puedes contribuir con nuevos temas** si lo deseas :D
-
-### Personalización
-
-Puedes personalizar el aspecto de tu `Tarjeta de Estadísticas` o `Tarjeta de Repo` de la manera que desees con los parámetros URL.
-
-#### Opciones Comunes:
-
-- `title_color` - Color del título _(hex color)_
-- `text_color` - Color del contenido _(hex color)_
-- `icon_color` - Color de icono si esta disponible _(hex color)_
-- `bg_color` - Color de fondo _(hex color)_
-- `hide_border` - Oculta el borde de la tarjeta _(booleano)_
-- `theme` - Nombre del tema, elige uno de [todos los temas disponible ](../themes/README.md)
-- `cache_seconds` - Cache _(min: 14400, max: 86400)_
-- `locale` - configurar el idioma en la tarjeta _(p.ej. cn, de, es, etc.)_
-
-##### Gradiente en `bg_color`
-
-Puedes pasar mútliples valores separados por coma en la opción `bg_color` para dibujar un gradiente, el formato del gradiente es:
-
-```
-&bg_color=DEG,COLOR1,COLOR2,COLOR3...COLOR10
-```
-
-> Nota sobre la caché: las tarjetas de Repo tienen un caché predeterminado de 4 horas (14400 segundos) si el recuento forks y el recuento de estrellas es inferior a 1k; de lo contrario, son 2 horas (7200 segundos). También ten en cuenta que la caché está sujeta a un mínimo de 2 horas y un máximo de 24 horas
-
-#### Opciones exclusivas de la Tarjeta de Estadísticas:
-
-- `hide` - Oculta de las estadísticas [los elementos especificados](#ocultar-estadísticas-individualmente) _(valores separados por comas)_
-- `hide_title` - _(booleano)_
-- `hide_rank` - _(booleano)_
-- `show_icons` - _(booleano)_
-- `include_all_commits` - Cuenta el total de commits en lugar de solo los commits del año actual _(boolean)_
-- `count_private` - Cuenta los commits privadas _(boolean)_
-- `line_height` - Establece el alto de línea entre texto _(número)_
-- `custom_title` - Establece un título personalizado
-- [`disable_animations`] - Desactiva todas las animaciones _(booleano)_
-
-#### Opciones exclusivas de la Tarjeta de Repo:
-
-- `show_owner` - Mostrar el nombre del propietario del repositorio _(booleano)_
-
-#### Opciones exclusivas de la Tarjeta de Lenguajes:
-
-- `hide` - Oculta de la tarjeta los lenguajes especificados _(valores separados por comas)_
-- `hide_title` - _(booleano)_
-- `layout` - Cambiar entre los cinco diseños disponibles `normal` & `compact` & `donut` & `donut-vertical` & `pie`
-- `card_width` - Establece el ancho de la tarjeta manualmente _(número)_
-- `langs_count` - Muestra más lenguajes en la tarjeta, entre 1-10, por defecto 5 _(número)_
-- `exclude_repo` - Excluye los repositorios especificados _(valores separados por comas)_
-- `custom_title` - Establece un título personalizado
-
-> :warning: **Importante:**
-> Los nombres de los lenguajes deben estar codificados para URLs, como se especifica en [Código porciento](https://es.wikipedia.org/wiki/C%C3%B3digo_porciento)
-> (es decir: `c++` debería convertirse en `c%2B%2B`,`jupyter notebook` debería convertirse en `jupyter%20notebook`, etc.)
-
-#### Opciones exclusivas de la Tarjeta de WakaTime:
-
-- `hide_title` - _(booleano)_
-- `line_height` - Establece el alto de línea entre texto _(número)_
-- `hide_progress` - Oculta la barra de progreso y el porcentaje _(booleano)_
-- `custom_title` - Establece un título personalizado
-- `layout` - Cambia entre los dos diseños disponibles `default` & `compact`
-- `langs_count` - Limita el número de idiomas que aparecen en el mapa
-- `api_domain` - Establece un dominio de API personalizado para la tarjeta
-
----
-
-# Pines adicionales de GitHub
-
-Los pines adicionales de GitHub le permiten fijar más de 6 repositorios en su perfil utilizando un perfil readme de GitHub.
-
-¡Yey! Ya no está limitado a 6 repositorios pinneados.
-
-### Utilización
-
-Copia y pegua este código en tu Readme y cambia los enlaces.
-
-Endpoint: `api/pin?username=anuraghazra&repo=github-readme-stats`
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Ejemplo
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-Utiliza la variable [show_owner](#customización) para incluir el nombre de usuario del propietario del repositorio.
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-# Tarjeta de Lenguajes Principales
-
-La tarjeta de lenguajes principales muestra los lenguajes principales del usuario de GitHub que se han utilizado principalmente.
-
-_NOTA: los lenguajes principales no indican mi nivel de habilidad o algo así, es una métrica de GitHub de los lenguajes que tengo más código en GitHub. Es una nueva característica de github-readme-stats_
-
-### Utilización
-
-Copia y pegua este código en tu Readme y cambia los enlaces.
-
-Endpoint: `api/top-langs?username=anuraghazra`
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Excluir repositorios individualmente
-
-Puedes usar el parámetro `?exclude_repo=repo1,repo2` para ocultar repositorios individualmente.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Ocultar lenguajes individualmente
-
-Puedes usar el parámetro `?hide=language1,language2` para ocultar lenguajes individualmente.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Mostrar más lenguajes
-
-Puedes usar el paramétro `&langs_count=` para incrementar o decrementar el número de lenguajes mostrados en la tarjeta. Los valores admitidos son los números enteros entre 1 y 10 (inclusive), y el valor por defecto es 5.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Diseño Compacto de Tarjeta de Lenguaje
-
-Puedes usar la opción `& layout = compact` para cambiar el diseño de la tarjeta.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Ejemplo
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-- Diseño compacto
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-# Estadísticas de la semana de WakaTime
-
-cambia el valor del parámetro `?username=` a tu username en [WakaTime](https://wakatime.com).
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Ejemplo
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-- Diseño compacto
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
----
-
-### Todos los ejemplos
-
-- Por defecto
-
-
-
-- Ocultando ciertas estadísticas
-
-
-
-- Mostrando íconos
-
-
-
-- Incluyendo todos los commits
-
-
-
-- Temas
-
-Escoja cualquiera de los [temas por defecto](#themes)
-
-
-
-- Gradiente
-
-
-
-- Personalizando Tarjeta de Estadísticas
-
-
-
-- Estableciendo Idioma de la tarjeta
-
-
-
-- Personalizando Tarjeta de Repo
-
-
-
-- Lenguajes Top
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-- Tarjeta de WakaTime
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
----
-
-### Consejo rápido (para alinear las tarjetas de repositorio)
-
-Por lo general, no podrás acomodar las imágenes una al lado de la otra. Para hacerlo, puede usar este enfoque:
-
-```html
-
-
-
-
-
-
-```
-
-## Despliega tu propia instancia de Vercel
-
-#### [Échale un vistazo a este tutorial paso a paso de @codeSTACKr](https://youtu.be/n6d4KHSKqGk?t=107)
-
-Desde que la API de GitHub permite solo 5k peticiones por hora, es posible que mi `https://github-readme-stats.vercel.app/api` pueda llegar al límite. Si lo alojas en tu propio servidor de Vercel, no tendrás que preocuparte de nada. ¡Clickea en el botón "Deploy" para comenzar!
-
-NOTA: Debido a [#58](https://github.com/anuraghazra/github-readme-stats/pull/58) podríamos manejar más de 5k peticiones sin tener ningún problema con el downtime :D
-
-[](https://vercel.com/import/project?template=https://github.com/anuraghazra/github-readme-stats)
-
-
- Guía para comenzar en Vercel
-
-1. Ve a [vercel.com](https://vercel.com/)
-2. Clickea en `Log in`
- 
-3. Inicia sesión con GitHub presionando `Continue with GitHub`
- 
-4. Permite el acceso a todos los repositorios (si se te pregunta)
-5. Haz un Fork de este repositorio
-6. Dirígete de nuevo a tu [Vercel dashboard](https://vercel.com/dashboard)
-7. Selecciona `Import Project`
- 
-8. Selecciona `Import Git Repository`
- 
-9. Selecciona "root" y matén todo como está, simplemente añade tu variable de entorno llamada PAT_1 (como se muestra), la cual contendrá un token de acceso personal (PAT), el cual puedes crear fácilmente [aquí](https://github.com/settings/tokens/new) (mantén todo como está, simplemente asígnale un nombre, puede ser cualquiera que desees)
- 
-10. Clickea "Deploy" y ya está listo. ¡Ve tus dominios para usar la API!
-
-
-
-## :sparkling_heart: Apoya al proyecto
-
-Casi todos mis proyectos son de código abierto e intento responder a todos los usuarios que necesiten ayuda con alguno de estos proyectos. Obviamente, esto toma tiempo. Puedes usar este servicio gratis.
-
-No obstante, si estás utilizando este proyecto y estás feliz con él o simplemente quieres animarme a que siga creando cosas, aquí tienes algunas maneras de hacerlo:
-
-- Darme créditos cuando estés utilizando github-readme-stats en tu README, añadiendo un link a este repositorio :D
-- Dándole una estrella y compartiendo el proyecto :rocket:
-- [](https://www.paypal.me/anuraghazra) - Puedes hacerme una única donación a través de PayPal. Probablemente me compraré un ~~café~~ té. :tea:
-
-¡Gracias! :heart:
-
----
-
-[](https://vercel.com?utm_source=github_readme_stats_team&utm_campaign=oss)
-
-¡Las contribuciones son bienvenidas! <3
-
-Hecho con :heart: y JavaScript.
diff --git a/docs/readme_fr.md b/docs/readme_fr.md
deleted file mode 100644
index 0f035f96e76d7..0000000000000
--- a/docs/readme_fr.md
+++ /dev/null
@@ -1,353 +0,0 @@
-
-
-
GitHub Readme Stats
-
Obtenez des statistiques GitHub générées dynamiquement sur vos Readme !
Vous aimez ce projet? Pensez à faire un don pour l'améliorer!
-
-# Features
-
-- [Carte des Stats GitHub](#carte-des-stats-github)
- - [Cacher les statistiques individuelles](#cacher-les-statistiques-individuelles)
- - [Afficher les icônes](#afficher-les-icônes)
- - [Thèmes](#thèmes)
- - [Personnalisation](#personnalisation)
-- [GitHub Extra Pins](#github-extra-pins)
- - [Usage](#usage)
- - [Démo](#démo)
-- [Carte des langages les + utilisés](#carte-des-langages-les--utilisés)
- - [Usage](#usage-1)
- - [Cacher certaines langages](#cacher-certaines-langages)
- - [Carte compacte des langages](#carte-compacte-des-langages)
- - [Démo](#démo-1)
- - [Toutes les démos](#toutes-les-démos)
- - [Conseil rapide (aligner les cartes des dépôts)](#conseil-rapide-aligner-les-cartes-des-dépôts)
- - [Déployer sur votre propre instance Vercel](#déployer-sur-votre-propre-instance-vercel)
- - [:sparkling\_heart: Supporter le project](#sparkling_heart-supporter-le-project)
-
-# Carte des Stats GitHub
-
-Copiez-collez ceci dans votre Markdown, et c'est tout. C'est simple !
-
-Remplacez la valeur `?username=` par le nom d'utilisateur de votre GitHub.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-_Note: Les rangs sont calculés sur la base des statistiques de l'utilisateur, voir [src/calculateRank.js](../src/calculateRank.js)_
-
-### Cacher les statistiques individuelles
-
-Pour masquer des statistiques spécifiques, vous pouvez passer un paramètre de requête `?hide=` avec des valeurs séparées par des virgules.
-
-> Options: `&hide=stars,commits,prs,issues,contribs`
-
-```md
-
-```
-
-### Afficher les icônes
-
-Pour activer les icônes, vous pouvez passer `show_icons=true` dans le paramètre de requête, comme ceci :
-
-```md
-
-```
-
-### Thèmes
-
-Avec les thèmes intégrés, vous pouvez personnaliser l'apparence de la carte sans faire de [personnalisation manuelle](#customization).
-
-Use `?theme=THEME_NAME` parameter like so :-
-
-```md
-
-```
-
-#### Tous les thèmes intégrés :-
-
-dark, radical, merko, gruvbox, tokyonight, onedark, cobalt, synthwave, highcontrast, dracula
-
-
-
-Vous pouvez consulter un aperçu de [tous les thèmes disponibles](../themes/README.md) ou consulter le [fichier de configuration des thèmes](../themes/index.js) & **vous pouvez également ajouter de nouveaux thèmes** si vous le souhaitez :D
-
-### Personnalisation
-
-Vous pouvez personnaliser l'apparence de votre `Carte des stats` ou `Carte de dépôt` comme vous le souhaitez avec les paramètres d'URL.
-
-#### Options principales:
-
-- `title_color` - Couleur du titre de la carte _(hex color)_
-- `text_color` - Couleur du texte _(hex color)_
-- `icon_color` - Couleur des icônes si disponibles _(hex color)_
-- `bg_color` - Couleur du fond de la carte _(hex color)_ **ou** un gradiant de la forme _angle,start,end_
-- `hide_border` - Cache la bordure de la carte _(booléen)_
-- `theme` - Nom du thème, parmis [tous les thèmes disponibles](../themes/README.md)
-- `cache_seconds` - Paramétrer le cache manuellement _(min: 14400, max: 86400)_
-- `locale` - définir la langue de la carte _(par exemple. cn, de, es, etc.)_
-
-##### Gradient in bg_color
-
-Vous pouvez fournir plusieurs valeurs (suivie d'une virgule) dans l'option bg_color pour rendre un degradé, le format du degradé est :-
-
-```
-&bg_color=DEG,COLOR1,COLOR2,COLOR3...COLOR10
-```
-
-> Note relative: Les cartes dépôt ont un cache par défaut de 30 minutes (1800 secondes) si le nombre de bifurcations et d'étoiles est inférieur à 1K, alors il est de 2 heures (7200). Notez également que la mémoire cache est limitée à 30 minutes au minimum et à 24 heures au maximum.
-
-#### Stats Card Exclusive Options:
-
-- `hide` - Masquer [les éléments spécifiés](#cacher-les-statistiques-individuelles) dans les statistiques _(Comma seperated values)_
-- `hide_title` - Masquer le titre _(boolean)_
-- `hide_rank` - Masquer le rang _(boolean)_
-- `show_icons` - Afficher les icônes _(boolean)_
-- `include_all_commits` - Compter le total de commits au lieu de ne compter que les commits de l'année en cours _(boolean)_
-- `count_private` - Compter les contributions privées _(boolean)_
-- `line_height` - Fixer la hauteur de la ligne entre les textes _(number)_
-
-#### Repo Card Exclusive Options:
-
-- `show_owner` - Affiche le nom du propriétaire du dépôt _(boolean)_
-
-#### Language Card Exclusive Options:
-
-- `hide` - Masquer les langages spécifiés sur la carte _(Comma seperated values)_
-- `hide_title` - Masquer le titre _(boolean)_
-- `layout` - Alterner entre 5 mise en page `normal` & `compact` & `donut` & `donut-vertical` & `pie`
-- `card_width` - Fixer la largeur de la carte manuellement _(number)_
-
-> :warning: **Important:**
-> Les noms des langages doivent être en format uri, comme spécifié dans [Percent Encoding](https://fr.wikipedia.org/wiki/Percent-encoding)
-> (c'est-à-dire que: `c++` devrait devenir `c%2B%2B`, `jupyter notebook` devrait devenir `jupyter%20notebook`, etc.)
-
----
-
-# GitHub Extra Pins
-
-Les épingles supplémentaires GitHub vous permettent d'épingler plus de 6 dépôts dans votre profil en utilisant un profil GitHub readme.
-
-Et OUI ! Vous n'êtes plus limité à 6 dépôts épinglés.
-
-### Usage
-
-Copiez-collez ce code dans votre readme et modifiez les liens.
-
-Extrémité: `api/pin?username=anuraghazra&repo=github-readme-stats`
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Démo
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-Utiliser la variable [show_owner](#customization) pour inclure le nom d'utilisateur du propriétaire du dépôt.
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-# Carte des langages les + utilisés
-
-La carte des langages principaux montre les langages les plus utilisés par les utilisateurs de GitHub.
-
-_NOTE: Les langages affichés n'indiquent pas mon niveau de compétence ou quelque chose comme ça, c'est une métrique GitHub de quelles langages j'ai le plus de code sur GitHub, c'est une nouvelle fonctionnalité de github-readme-stats_
-
-### Usage
-
-Copiez-collez ce code dans votre readme et modifiez les liens.
-
-Extrémité: `api/top-langs?username=anuraghazra`
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Cacher certaines langages
-
-Vous pouvez utiliser le paramètre `?hide=language1,language2` pour masquer les langages individuels.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Carte compacte des langages
-
-Vous pouvez utiliser l'option `&layout=compact` pour changer le style de la carte.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Démo
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-- Carte compacte
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
----
-
-### Toutes les démos
-
-- Défaut
-
-
-
-- Ne pas afficher des stats spécifiques
-
-
-
-- Afficher les icônes
-
-
-
-- Inclure tous les commits
-
-
-
-- Thèmes
-
-Choisissez parmi l'un des [thèmes par défaut](#themes)
-
-
-
-- Dégradé
-
-
-
-- Personnaliser la carte des stats
-
-
-
-- Personnaliser la carte dépôt
-
-
-
-- Top Langages
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
----
-
-### Conseil rapide (aligner les cartes des dépôts)
-
-En général, vous ne pourrez pas mettre les images côte à côte. Pour ce faire, vous pouvez utiliser cette approche :
-
-```html
-
-
-
-
-
-
-```
-
-## Déployer sur votre propre instance Vercel
-
-#### [Check Out Step By Step Video Tutorial By @codeSTACKr](https://youtu.be/n6d4KHSKqGk?t=107)
-
-Comme l'API GitHub ne permet que 5k requêtes par heure, il est possible que mon `https://github-readme-stats.vercel.app/api` puisse atteindre le limiteur de débit. Si vous l'hébergez sur votre propre serveur Vercel, alors vous n'avez pas à vous soucier de quoi que ce soit. Cliquez sur le bouton de déploiement pour commencer !
-
-NOTE: Depuis [#58](https://github.com/anuraghazra/github-readme-stats/pull/58) nous devrions être en mesure de traiter plus de 5 000 demandes et ne pas avoir de problèmes de temps d'arrêt :D
-
-[](https://vercel.com/import/project?template=https://github.com/anuraghazra/github-readme-stats)
-
-
- Guide pour la mise en place de Vercel 🔨
-
-1. Allez sur [vercel.com](https://vercel.com/)
-1. Cliquez sur `Log in`
- 
-1. Connectez-vous avec GitHub en cliquant `Continue with GitHub`
- 
-1. Connectez-vous à GitHub et autorisez l'accès à tous les dépôts, si vous y êtes invité
-1. Forkez ce dépôt
-1. Retournez au [dashboard Vercel](https://vercel.com/dashboard)
-1. Sélectionnez `Import Project`
- 
-1. Sélectionnez `Import Git Repository`
- 
-1. Choisissez root et gardez tout tel quel, ajoutez simplement votre variable d'environnement nommée PAT_1 (comme indiqué), qui contiendra un jeton d'accès personnel (PAT), que vous pouvez facilement créer [ici](https://github.com/settings/tokens/new) (laissez tout tel quel, nommez le simplement quelque chose, cela peut être tout ce que vous voulez)
- 
-1. Cliquez sur "Deploy" et vous êtes prêt à partir. Regardez vos domaines pour utiliser l'API !
-
-
-
-## :sparkling_heart: Supporter le project
-
-Je mets open-source presque tout ce que je peux, et j'essaie de répondre à tous ceux qui ont besoin d'aide en utilisant ces projets. Évidemment, cela prend du temps. Vous pouvez utiliser ce service gratuitement.
-
-Cependant, si vous utilisez ce projet et que vous en êtes satisfait ou si vous voulez simplement m'encourager à continuer à créer, il y a quelques façons de le faire :-
-
-- Donner un crédit approprié lorsque vous utilisez github-readme-stats sur votre readme, avec un lien vers celui-ci :D
-- Mettre une étoile et partager le projet :rocket:
-- [](https://www.paypal.me/anuraghazra) - Vous pouvez faire des dons uniques via PayPal. Je vais probablement acheter un ~~café~~ thé. :tea:
-
-Merci ! :heart:
-
----
-
-[](https://vercel.com?utm_source=github_readme_stats_team&utm_campaign=oss)
-
-
-Les contributions sont les bienvenues ! <3
-
-Fait avec :heart: et JavaScript.
diff --git a/docs/readme_it.md b/docs/readme_it.md
deleted file mode 100644
index 8f16f4e6bd080..0000000000000
--- a/docs/readme_it.md
+++ /dev/null
@@ -1,365 +0,0 @@
-
-
-
GitHub Readme Stats
-
Mostra nei tuoi README file le statistiche GitHub generate dinamicamente!
Se ti piace questo progetto, considera la possibilità di donare per aiutare a renderlo migliore!
-
-# Caratteristiche
-
-- [GitHub Stats Card](#github-stats-card)
- - [Nascondere statistiche individuali](#nascondere-statistiche-individuali)
- - [Includere i contributi privati nel computo totale](#includere-i-contributi-privati-nel-computo-totale)
- - [Mostrare le icone](#mostrare-le-icone)
- - [Temi](#temi)
- - [Personalizzazione](#personalizzazione)
-- [GitHub Extra Pins](#github-extra-pins)
- - [Utilizzo](#utilizzo)
- - [Demo](#demo)
-- [Top Languages Card](#top-languages-card)
- - [Utilizzo](#utilizzo-1)
- - [Nascondi linguaggi specifici](#nascondi-linguaggi-specifici)
- - [Layout compatto](#layout-compatto)
- - [Demo](#demo-1)
- - [Galleria di esempi](#galleria-di-esempi)
- - [Consiglio veloce (Allineare le Card)](#consiglio-veloce-allineare-le-card)
- - [Deploy su Vercel](#deploy-su-vercel)
- - [:sparkling\_heart: Supporta il progetto](#sparkling_heart-supporta-il-progetto)
-
-
-# GitHub Stats Card
-
-Per creare una Card con le statistiche GitHub, copia e incolla nel tuo file markdown, tutto qua: è semplice!
-
-Ricorda di cambiare il valore `?username=` con il tuo nome utente GitHub.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-_Nota: I punteggi sono calcolati sulla base delle tue statistiche, dai un'occhiata a [src/calculateRank.js](../src/calculateRank.js) per ulteriori informazioni_
-
-### Nascondere statistiche individuali
-
-Per nascondere qualche dato, puoi aggiungere i parametri `?hide=`, separando i valori con una virgola.
-
-> Opzioni: `&hide=stars,commits,prs,issues,contribs`
-
-```md
-
-```
-
-### Includere i contributi privati nel computo totale
-
-Puoi aggiungere i tuoi contributi privati al totale dei commit, utilizzando il parametro `?count_private=true`.
-
-_Nota: se hai deciso di fare il deploy del progetto, i contributi privati verranno inclusi in automatico._
-
-> Opzioni: `&count_private=true`
-
-```md
-
-```
-
-### Mostrare le icone
-
-Per abilitare le icone, puoi specificare `show_icons=true`, ad esempio:
-
-```md
-
-```
-
-### Temi
-
-Esistono alcuni temi predefiniti coi quali è possibile personalizzare l'aspetto delle card. In alternativa, è possibile effettuare una [personalizzazione manuale](#personalizzazione).
-
-Usa il parametro `?theme=NOME_TEMA` in questo modo:-
-
-```md
-
-```
-
-#### Galleria dei temi:-
-
-dark, radical, merko, gruvbox, tokyonight, onedark, cobalt, synthwave, highcontrast, dracula
-
-
-
-Puoi avere un'anteprima di [tutti i temi supportati](../themes/README.md) o controllare il [file di configurazione dei temi](../themes/index.js) e **puoi anche contribuire creando un nuovo tema** se vuoi :D
-
-### Personalizzazione
-
-Puoi personalizzare l'aspetto delle tue `Stats Card` o delle `Repo Card` in qualsiasi modo, semplicemente modificando i parametri dell'URL.
-
-#### Opzioni comuni:
-
-- `title_color` - Colore del titolo _(in esadecimale)_
-- `text_color` - Colore del testo _(in esadecimale)_
-- `icon_color` - Colore delle icone, se disponibili _(in esadecimale)_
-- `bg_color` - Colore dello sfondo _(in esadecimale)_ **oppure** un gradiente nella forma _angolo,inizio,fine_
-- `hide_border` - Nasconde il bordo della carta _(booleano)_
-- `theme` - Nome del tema, dai un'occhiata a [tutti i temi disponibili](../themes/README.md)
-- `cache_seconds` - Specifica manualmente il valore di cache, in secondi _(min: 14400, max: 86400)_
-- `locale` - Impostare la lingua nella scheda _(per esempio. cn, de, es, eccetera.)_
-
-##### Gradiente nello sfondo
-
-Puoi fornire valori separati da virgola nel parametro bg_color per creare un gradiente, il cui formato è:-
-
-```
-&bg_color=DEG,COLOR1,COLOR2,COLOR3...COLOR10
-```
-
-> Nota sulla cache: le card hanno un valore di cache di 4 ore (14400 seconds) di default se il numero di fork & il numero di stelle è inferiore a 1000; altrimenti è pari a 2 ore (7200).
-
-#### Opzioni valide solo per le card delle statistiche:
-
-- `hide` - Nasconde gli oggetti selezionati _(valori separati da virgola)_
-- `hide_title` - Nasconde il titolo _(booleano)_
-- `hide_rank` - Nasconde il punteggio _(booleano)_
-- `show_icons` - Mostra le icone _(booleano)_
-- `include_all_commits` - Mostra tutti i commit e non solo quelli dell'anno corrente _(booleano)_
-- `count_private` - Include i contributi privati _(booleano)_
-- `line_height` - Specifica il valore dell'altezza di riga _(numero)_
-
-#### Opzioni valide solo per le Repo Card:
-
-- `show_owner` - Mostra il nome utente del proprietario _(booleano)_
-
-#### Opzioni valide solo per le card dei linguaggi:
-
-- `hide` - Nasconde un linguaggio specifico _(valori separati da virgola)_
-- `hide_title` - Nasconde il titolo _(booleano)_
-- `layout` - Specificare il tipo di layout, `normal` (esteso), `compact` (compatto), `donut` (ciambella), `donut-vertical` (ciambella verticale) e `pie` (torta)
-- `card_width` - Specifica il valore della larghezza _(numero)_
-
-> :warning: **Importante:**
-> Per i nomi dei linguaggi, assicurati di effettuare l'encoding giusto nell'uri, come specificato in [Percent Encoding](https://en.wikipedia.org/wiki/Percent-encoding)
-> (ad esempio: `c++` diventa `c%2B%2B`, `jupyter notebook` diventa `jupyter%20notebook`, ecc.)
-
----
-
-# GitHub Extra Pins
-
-GitHub Extra Pins ti permette di fissare in alto più di 6 repository nel tuo profilo, sfruttando il README del profilo.
-
-### Utilizzo
-
-Copia e incolla il seguente codice, premurandoti di cambiare il link.
-
-Endpoint: `api/pin?username=anuraghazra&repo=github-readme-stats`
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Demo
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-Usa la variabile [show_owner](#personalizzazione) per includere il nome utente del proprietario
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-# Top Languages Card
-
-La Top Languages Card mostra i linguaggi che utilizzi di più su GitHub.
-
-_NOTA: questa card non indica il livello di abilità, ma piuttosto quanto codice hai scritto in un determinato linguaggio_
-
-### Utilizzo
-
-Copia e incolla nel tuo file README, cambiando i link.
-
-Endpoint: `api/top-langs?username=anuraghazra`
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Nascondi linguaggi specifici
-
-Puoi utilizzare il parametro `?hide=linguaggio1,linguaggio2` per nascondere alcuni linguaggi.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Layout compatto
-
-Puoi utilizzare l'opzione `&layout=compact` per cambiare l'aspetto della card.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Demo
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-- Layout Compatto
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
----
-
-### Galleria di esempi
-
-- Default
-
-
-
-- Nascondere dati specifici
-
-
-
-- Mostrare le icone
-
-
-
-- Includere tutti i commit
-
-
-
-- Temi
-
-Scegli uno dei [temi di default](#themes)
-
-
-
-- Gradiente
-
-
-
-- Personalizzare le Stats Card
-
-
-
-- Personalizzare le Repo Card
-
-
-
-- Linguaggi più usati
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
----
-
-### Consiglio veloce (Allineare le Card)
-
-Per allineare le card una accanto all'altra, puoi adottare questo approccio:
-
-```html
-
-
-
-
-
-
-```
-
-## Deploy su Vercel
-
-#### [Guarda questo Video Tutorial, realizzato da @codeSTACKr](https://youtu.be/n6d4KHSKqGk?t=107)
-
-Since the GitHub API only allows 5k requests per hour, it is possible that my `https://github-readme-stats.vercel.app/api` could hit the rate limiter. If you host it on your own Vercel server, then you don't 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 no issues with downtime :D
-
-[](https://vercel.com/import/project?template=https://github.com/anuraghazra/github-readme-stats)
-
-
- Guide on setting up Vercel 🔨
-
-1. Go to [vercel.com](https://vercel.com/)
-1. Click on `Log in`
- 
-1. Sign in with GitHub by pressing `Continue with GitHub`
- 
-1. Sign into GitHub and allow access to all repositories, if prompted
-1. Fork this repo
-1. Go back to your [Vercel dashboard](https://vercel.com/dashboard)
-1. Select `Import Project`
- 
-1. Select `Import Git Repository`
- 
-1. Select root and keep everything as is, just add your environment variable named PAT_1 (as shown), which will contain a personal access token (PAT), which you can easily create [here](https://github.com/settings/tokens/new) (leave everything as is, just name it something, it can be anything you want)
- 
-1. Click deploy, and you're good to go. See your domains to use the API!
-
-
-
-## :sparkling_heart: Supporta il progetto
-
-Rendo open-source quasi tutto ciò che posso e provo a rispondere a chiunque sia in difficoltà nell'utilizzare questi progetti. Ovviamente, mi richiede del tempo.
-Puoi utilizzare questo servizio gratuitamente.
-
-Tuttavia, se usi il progetto e ti piace e vuoi sostenermi, puoi:-
-
-- Dare il giusto riconoscimento quando usi github-readme-stats nei tuoi readme, includendo un link :D
-- Mettere una stella e condividere il progetto :rocket:
-- [](https://www.paypal.me/anuraghazra) - Fare una donazione via PayPal. Probabilmente compreròun ~~caffè~~ tè. :tea:
-
-Grazie! :heart:
-
----
-
-[](https://vercel.com?utm_source=github_readme_stats_team&utm_campaign=oss)
-
-I contributi sono benvenuti! <3
-
-Realizzato col :heart: e in JavaScript.
diff --git a/docs/readme_ja.md b/docs/readme_ja.md
deleted file mode 100644
index d338785f909d8..0000000000000
--- a/docs/readme_ja.md
+++ /dev/null
@@ -1,372 +0,0 @@
-
기능들이 마음에 드시나요? 괜찮으시다면, 서비스 개선을 위해 기부를 고려해주세요!
-
-# 기능들
-
-- [GitHub 통계](#github-통계)
- - [개별 통계 숨기기](#개별-통계-숨기기)
- - [총 커밋 수에 비공개 기여도 (private contribs) 수 추가하기](#총-커밋-수에-비공개-기여도-private-contribs-수-추가하기)
- - [아이콘 표시하기](#아이콘-표시하기)
- - [테마 설정하기](#테마-설정하기)
- - [커스터마이징](#커스터마이징)
-- [GitHub 저장소 핀](#github-저장소-핀)
- - [사용법](#사용법)
- - [미리보기](#미리보기)
-- [언어 사용량 통계](#언어-사용량-통계)
- - [사용법](#사용법-1)
- - [통계에서 제외할 저장소 지정하기](#통계에서-제외할-저장소-지정하기)
- - [통계에서 특정 언어 제외하기](#통계에서-특정-언어-제외하기)
- - [표시할 언어 수 지정하기](#표시할-언어-수-지정하기)
- - [컴택트한 카드 레이아웃 설정하기](#컴택트한-카드-레이아웃-설정하기)
- - [미리보기](#미리보기-1)
-- [WakaTime 주간 통계](#wakatime-주간-통계)
- - [미리보기](#미리보기-2)
- - [전체 미리보기](#전체-미리보기)
- - [꿀팁 (저장소 핀 정렬하기)](#꿀팁-저장소-핀-정렬하기)
- - [나만의 Vercel 인스턴스에 직접 배포하기](#나만의-vercel-인스턴스에-직접-배포하기)
- - [:sparkling\_heart: 프로젝트 지원하기!](#sparkling_heart-프로젝트-지원하기)
-
-
-# GitHub 통계
-
-아래 코드를 복사해서 마크다운 파일에 붙여넣으면 끝이에요, 아주 간단해요!
-
-`?username=` 속성의 값을 GitHub 계정의 사용자 명(닉네임)으로 바꿔주세요.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-_참고:_
-
-_랭크는 S+ (상위 1%), S (상위 25%), A++ (상위 45%), A+ (상위 60%), 그리고 B+ (전체) 로 구성되어 있습니다._
-
-_커밋의 수(commits), 기여도(contribution), 이슈의 수(issues), 즐겨찾기(star), 작업내용 반영 요청(Pull Request),
-팔로워 수, 그리고 보유 중인 저장소 등의 항목들에 대해 [누적 분포 함수](https://ko.wikipedia.org/wiki/%EB%88%84%EC%A0%81_%EB%B6%84%ED%8F%AC_%ED%95%A8%EC%88%98) 를 이용해 계산됩니다._
-
-_[src/calculateRank.js](../src/calculateRank.js) 에서 수행되는 계산 작업의 내용을 확인할 수 있습니다._
-
-### 개별 통계 숨기기
-
-특정 통계를 숨기려면 `콤마(,)`로 구분된 값들을 `?hide=` 속성의 값으로 넣어주세요.
-
-> 사용 가능한 항목들: `&hide=stars,commits,prs,issues,contribs`
-
-```md
-
-```
-
-### 총 커밋 수에 비공개 기여도 (private contribs) 수 추가하기
-
-`?count_private=true` 속성을 추가하시면, 여러분의 모든 비공개 기여도까지 반영됩니다.
-
-_참고: 프로젝트를 직접 배포하신 경우, 비공개 기여도는 기본적으로 반영됩니다. 원하지 않는 경우엔 직접 설정해야 합니다._
-
-> 예시: `&count_private=true`
-
-```md
-
-```
-
-### 아이콘 표시하기
-
-아이콘 항목을 활성화 하기 위해선, 다음과 같이 `show_icons=true` 속성을 추가해주세요.
-
-```md
-
-```
-
-### 테마 설정하기
-
-내장 테마를 사용하시면, 별도의 [커스터마이징](#커스터마이징) 없이 GitHub 통계 카드를 꾸미실 수 있어요.
-
-다음과 같이 `?theme=THEME_NAME` 속성을 이용해주세요.
-
-```md
-
-```
-
-#### 지원하는 내장 테마 목록
-
-dark, radical, merko, gruvbox, tokyonight, onedark, cobalt, synthwave, highcontrast, dracula
-
-
-
-[사용 가능한 모든 테마](../themes/README.md) 에서 미리보기를 확인하실 수 있어요.
-
-원하신다면 [테마 설정하기](../themes/index.js) 항목에서 **새로운 테마를 직접 만드실수 있어요.** :D
-
-### 커스터마이징
-
-여러가지 추가 속성을 통해, 원하는대로 `Stats Card` 또는 `Repo Card` 모양을 커스터마이징할 수 있어요.
-
-#### 기본 옵션:
-
-- `title_color` - 카드 타이틀 색상 _(hex color)_
-- `text_color` - 카드 본문 글씨 색상 _(hex color)_
-- `icon_color` - 아이콘 색상 (활성화된 경우) _(hex color)_
-- `bg_color` - 카드의 배경 색상 _(hex color)_ **혹은** 다음 양식으로 그라데이션 주기 _angle,start,end_
-- `hide_border` - 카드의 테두리 표시 여부 _(boolean)_
-- `theme` - 테마의 이름, [사용 가능한 모든 테마](../themes/README.md) 에서 선택
-- `cache_seconds` - 수동으로 캐시 헤더 설정 _(min: 14400, max: 86400)_
-- `locale` - 카드에 표시할 언어 _(e.g. kr, cn, de, es, etc.)_
-
-##### 배경에 그라데이션 주기
-
-그라데이션이 적용된 카드를 표시하고 싶으시다면, 여러가지 쉼표(,) 로 구분된 값을 추가할 수 있어요.
-
-양식은 다음과 같습니다.
-
-```
-&bg_color=DEG,COLOR1,COLOR2,COLOR3...COLOR10
-```
-
-> 캐시에 대한 참고사항:
-> 포크와 스타 수가 1,000 개 미만인 저장소의 카드는 기본적으로 4시간 (14,400초) 으로 설정되어 있습니다.
-> 그 외에는, it's 2시간 (7,200초) 입니다. 또한, 캐시설정 시간의 범위는 최소 2시간, 최대 24시간입니다.
-
-
-#### 통계 카드의 표시 제한 옵션:
-
-- `hide` - 통계에서 특정한 값 제외 _(Comma-separated values)_
-- `hide_title` - 타이틀 표시 여부 _(boolean)_
-- `hide_rank` - 랭크 표시 여부 _(boolean)_
-- `show_icons` - 아이콘 표시 여부 _(boolean)_
-- `include_all_commits` - 올해가 아닌 전체 연도에 대한 커밋 포함 여부 _(boolean)_
-- `count_private` - 비공개 기여도 포함 여부 _(boolean)_
-- `line_height` - 텍스트 간 줄 높이 설정(자간) _(number)_
-- `custom_title` - 카드의 타이틀 값 설정
-- `disable_animations` - 카드의 모든 에니메이션 활성 여부 _(boolean)_
-
-#### 저장소 카드의 표시 제한 옵션:
-
-- `show_owner` - 저장소 소유자 닉네임 표기 여부 _(boolean)_
-
-#### 언어 사용량 통계 카드의 표시 제한 옵션:
-
-- `hide` - 카드에서 특정 언어 제외 _(Comma-separated values)_
-- `hide_title` - 타이틀 제외 _(boolean)_
-- `layout` - 5가지 값 사용 가능, `normal` & `compact` & `donut` & `donut-vertical` & `pie` 중 표시 형태 선택
-- `card_width` - 카드 너비 직접 설정 _(number)_
-- `langs_count` - 카드에 표시할 언어의 수 (1-10 사이, 기본 값 : 5) _(number)_
-- `exclude_repo` - 통계에 제외할 저장소 지정 _(Comma-separated values)_
-- `custom_title` - 카드의 타이틀 값 설정
-
-##### 경고! **매우 중요**
->
-> 언어의 이름은 [퍼센트 인코딩](https://ko.wikipedia.org/wiki/%ED%8D%BC%EC%84%BC%ED%8A%B8_%EC%9D%B8%EC%BD%94%EB%94%A9) 에 지정된 URI 방식으로 표기되어야 합니다.
-> ( 예를 들면, `c++` 는 `c%2B%2B`, `jupyter notebook` 는 `jupyter%20notebook`, 등등. )
-> [urlencoder.org](https://www.urlencoder.org/) < 서비스를 이용하면 자동으로 생성할 수 있습니다.
-
-#### WakaTime 카드의 표시 제한 옵션:
-
-- `hide_title` - 타이틀 제외 _(boolean)_
-- `line_height` - 텍스트 간 줄 높이 설정(자간) _(number)_
-- `hide_progress` - 퍼센트와 표기바 표시 여부 _(boolean)_
-- `custom_title` - 카드의 타이틀 값 설정
-- `layout` - 사용 가능한 두 가지 값, `default` & `compact` 중 표시 형태 선택
-
----
-
-# GitHub 저장소 핀
-
-GitHub 저장소 여분 핀을 이용하면, 6개 이상의 저장소 핀을 여러분의 프로필에 추가할 수 있어요.
-
-맞아요! 이제 6개 이상의 핀을 사용할 수 있어요! (핀이 부족할 일이 없답니다!)
-
-### 사용법
-
-이 코드를 복사해서 여러분의 README 에 넣고 링크를 변경해주세요.
-
-엔드 포인트: `api/pin?username=anuraghazra&repo=github-readme-stats`
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### 미리보기
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-[show_owner](#커스터마이징) 속성을 통해 저장소 소유자의 닉네임 표시 여부를 설정할 수 있어요.
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-# 언어 사용량 통계
-
-언어 사용량 통계 카드는 GitHub 사용자가 가장 많이 사용한 언어가 표시됩니다.
-
-_참고:
-언어 사용량 통계는 GitHub 에서 가장 많이 사용된 언어의 표기일 뿐입니다.
-숙련도, 혹은 그와 비슷한 지표를 나타내진 않습니다. (새로 추가된 기능입니다!)_
-
-### 사용법
-
-이 코드를 복사해서 여러분의 README 에 넣고 링크를 변경해주세요.
-
-엔드 포인트: `api/top-langs?username=anuraghazra`
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### 통계에서 제외할 저장소 지정하기
-
-`?exclude_repo=repo1,repo2` 속성을 통해 특정 저장소를 제외할 수 있어요.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### 통계에서 특정 언어 제외하기
-
-`?hide=language1,language2` 속성을 통해 특정 언어를 제외할 수 있어요.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### 표시할 언어 수 지정하기
-
-`&langs_count=` 속성을 통해 카드에 표시할 언어의 수를 지정할 수 있어요. (1-10 사이, 기본 값 : 5)
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### 컴택트한 카드 레이아웃 설정하기
-
-`&layout=compact` 속성을 통해 카드의 디자인을 변경할 수 있어요.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### 미리보기
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-- 컴팩트한 레이아웃
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-# WakaTime 주간 통계
-
-`?username=` 속성의 값을 [WakaTime](https://wakatime.com) 계정의 사용자 명(닉네임)으로 바꿔주세요.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### 미리보기
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-- 컴팩트한 레이아웃
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
----
-
-### 전체 미리보기
-
-- 기본
-
-
-
-- 특정 통계 내용 숨김
-
-
-
-- 아이콘 표시
-
-
-
-- 전체 커밋 포함 시
-
-
-
-- 테마들
-
-[내장 테마](#themes) 에서 직접 선택해보세요
-
-
-
-- 그라데이션 주기
-
-
-
-- 통계 카드 커스터마이징하기
-
-
-
-- 언어 사용 지역 설정하기
-
-
-
-- 저장소 핀 커스터마이징하기
-
-
-
-- 언어 사용량 통계
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-- WakaTime 카드
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
----
-
-### 꿀팁 (저장소 핀 정렬하기)
-
-아마, 이미지들을 나란히 정렬할 수 없을거에요.
-
-그럴땐, 이렇게 해보세요!
-
-```html
-
-
-
-
-
-
-```
-
-## 나만의 Vercel 인스턴스에 직접 배포하기
-
-#### [@codeSTACKr 님의 튜토리얼 영상 보기](https://youtu.be/n6d4KHSKqGk?t=107)
-
-GitHub API 가 시간 당 요청 개수를 5,000회로 제한한 뒤로,
-저의 `https://github-readme-stats.vercel.app/api` 가 사용량 제한에 걸릴 위험이 생겼어요.
-
-만약, 여러분이 Vercel server 에서 직접 호스트 하신다면, 걱정하실 일은 없을거에요.
-
-아래의 버튼을 이용해 직접 배포해보세요!
-
-참고: [#58](https://github.com/anuraghazra/github-readme-stats/pull/58) 풀 리퀘스트 이후로, 저희는 5,000 개 이상의 요청을 처리할 수 있게 됐어요. 더이상 서버 다운에 대한 걱정은 노놉! :D
-
-[](https://vercel.com/import/project?template=https://github.com/anuraghazra/github-readme-stats)
-
-
- 🔨 Vercel 세팅 가이드!
-
-1. [vercel.com](https://vercel.com/) 으로 이동하기
-1. `Log in` 버튼 클릭!
- 
-1. `Continue with GitHub` 버튼을 이용해 GitHub 계정으로 가입하기
- 
-1. GitHub 에 로그인한 뒤, (권한을 요청한다면) 모든 저장소에 대한 권한을 허용해주세요!
-1. 이 저장소를 Fork!
-1. [Vercel 대시보드](https://vercel.com/dashboard) 로 돌아가세요!
-1. `Import Project` 항목 선택!
- 
-1. `Import Git Repository` 항목 선택!
- 
-1. 'root' 를 선택하고 넘어간 후, 아래와 같이 개인용 엑세스 토큰 (PAT) 을 저장할 환경변수를 PAT_1 의 값으로 추가해주세요. [이 곳](https://github.com/settings/tokens/new)에서 쉽게 생성할 수 있어요. (모든 항목을 그대로 두고, 이 부분만 원하는 이름으로 변경해주세요.)
- 
-1. 마지막으로 'Deploy' 버튼을 클릭하면, 끝! => API 를 사용하기 위한 도메인 주소를 확인하세요!
-
-
-
-## :sparkling_heart: 프로젝트 지원하기!
-
-저는 가능한 모든 요소들을 오픈소스로 공개하고,
-이 서비스를 이용하는데 도움이 필요한 모두에게 도움을 드리려 노력하고 있어요.
-
-솔직히 말하자면, 시간이 좀 걸린답니다...
-물론, 여러분이 이 서비스를 사용하는건 무료에요 ㅎ
-
-하지만, 만약 여러분이 이 서비스를 잘 이용하시고,
-만족하시거나, 제가 이런 요소들을 만드는 데에 도움을 주고 싶으시다면,
-여러분께서 도와주실 수 있는 것들이 있어요!
-
-- github-readme-stats 를 README 에 표시하실 때 확실한 도움을 주세요! 이 저장소로 링크를 걸어주시면 돼요! :D
-- 이 프로젝트를 많이 공유해주시고, 즐겨찾기 해주세요! :rocket:
-- [](https://www.paypal.me/anuraghazra) - PayPal 을 이용해 1회성 도네이션을 해주실 수 있어요. 아마도 전 ~~커피, 아... 아니~~ 차를 사서 마시겠죠? ㅎ; :tea:
-
-감사합니다! :heart:
-
----
-
-[](https://vercel.com?utm_source=github_readme_stats_team&utm_campaign=oss)
-
-프로젝트에 대한 기여는 언제나 환영이에요! <3
-
-Made with :heart: and JavaScript.
diff --git a/docs/readme_nl.md b/docs/readme_nl.md
deleted file mode 100644
index 7fbec69971517..0000000000000
--- a/docs/readme_nl.md
+++ /dev/null
@@ -1,424 +0,0 @@
-
-
-
GitHub Readme Stats
-
Krijg dynamisch gegenereerde GitHub statistieken op je readme's!
Bevalt het project? Doneer om het te verbeteren!
-
-# Functionaliteiten
-
-- [GitHub Statistieken Kaart](#github-statistieken-kaart)
- - [Verberg individueele statistieken](#verberg-individueele-statistieken)
- - [Voeg privé contributies toe aan totale commits.](#voeg-privé-contributies-toe-aan-totale-commits)
- - [Laat icoontjes zien](#laat-icoontjes-zien)
- - [Thema's](#themas)
- - [Opmaak](#opmaak)
-- [GitHub Extra Pins](#github-extra-pins)
- - [Gebruik](#gebruik)
- - [Demo](#demo)
-- [Top Programmeertalen Kaart](#top-programmeertalen-kaart)
- - [Gebruik](#gebruik-1)
- - [Verberg individueele repositories](#verberg-individueele-repositories)
- - [Verberg individueele talen](#verberg-individueele-talen)
- - [Laat meer programmeertalen zien](#laat-meer-programmeertalen-zien)
- - [Compacte Talen Kaart opmaak](#compacte-talen-kaart-opmaak)
- - [Demo](#demo-1)
-- [Wekelijkse WakaTime Statistieken](#wekelijkse-wakatime-statistieken)
- - [Demo](#demo-2)
- - [Alle demos](#alle-demos)
- - [Kleine tip (Verstel de repo kaart z'n positie)](#kleine-tip-verstel-de-repo-kaart-zn-positie)
- - [Deploy je eigen Vercel instatie](#deploy-je-eigen-vercel-instatie)
- - [:sparkling\_heart: Ondersteun het project](#sparkling_heart-ondersteun-het-project)
-
-# GitHub Statistieken Kaart
-
-Kopieer en plak dit in je markdown content, zo simpel is het!
-
-Verander de waarde `?username=` naar jou gebruikersnaam.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-_Notitie: Beschikbare rangen zijn S+ (top 1%), S (top 25%), A++ (top 45%), A+ (top 60%), and B+ (iedereen).
-De waarden worden berekend met behulp van de zogeheten [cumulative distribution function](https://en.wikipedia.org/wiki/Cumulative_distribution_function) met de waardes van de commits, bijdragens, issues, sterren, PR's, volgers en eigen repositories.
-De implementatie hiervan kan bekijken op [src/calculateRank.js](../src/calculateRank.js)_
-
-### Verberg individueele statistieken
-
-Om specifieke statistieken te verbergen, kan je een `?hide=` query parameter toevogen, verdeeld met komma\'s.
-
-
-> Opties: `&hide=stars,commits,prs,issues,contribs`
-
-```md
-
-```
-
-### Voeg privé contributies toe aan totale commits.
-
-Je kan de hoeveelheid privé commits toevoegen aan je totale hoeveelheid commits door de query parameter `?count_private=true` te gebruiken.
-
-_Notitie: Als je dit project zelf deployt, zullen de privé contributies standaard toegevoegt worden aan je totaal, omdat anders je hoeveelheid privé contributies moet delen._
-
-> Opties: `&count_private=true`
-
-```md
-
-```
-
-### Laat icoontjes zien
-
-Om icoontjes te gebruiken kan je `show_icons=true` gebruiken in de query parameter, zoals hier:
-
-```md
-
-```
-
-### Thema\'s
-
-Met ingebouwde thema\'s kan je het uiterlijk van de kaart aanpassen zonder enige [handmatige opmaak](#customization).
-
-Gebruik `?theme=THEME_NAME` parameters zo :-
-
-```md
-
-```
-
-#### Alle ingeboude thema\'s :-
-
-dark, radical, merko, gruvbox, tokyonight, onedark, cobalt, synthwave, highcontrast, dracula
-
-
-
-Je kan een preview van alle [beschikbare thema\'s](../themes/README.md) bekijken, of zie het [thema configuratie bestand](../themes/index.js) en **je kan aan nieuwe thema\'s bijdragen** als je dat leuk lijkt :D
-
-### Opmaak
-
-Je kan het uiterlijk van je `Statistieken kaart` of `Repo kaart` aanpassen hoe je ook maar wilt met URL parameters.
-
-#### Veel gebruikte opties:
-
-- `title_color` - De kleur van de titel van de kaart _(hex kleur)_
-- `text_color` - Tekst kleur _(hex kleur)_
-- `icon_color` - Icoon kleuren, wanneer beschikbaar _(hex kleur)_
-- `bg_color` - Achtergrond kleur van de kaart _(hex kleur)_ **of** een verloop van kleuren in het formaat van _graden,start,einde_
-- `hide_border` - Verbergt de rand van de kaart _(boolean)_
-- `theme` - Naam van het thema, kies uit [alle beschikbare thema\'s](../themes/README.md)
-- `cache_seconds` - Stel de cache header handmatig in _(min: 14400, max: 86400)_
-- `locale` - Stel taal van de kaart in _(e.g. cn, de, es, etc.)_
-
-##### Kleurenverloop in bg_color (achtergrond kleur):
-
-Je kan meerdere komma verdeelde waarden in de bg_color optie geven om een kleurenverloop te creeëren, het formaat van het kleurenverloop is:-
-
-```
-&bg_color=GRADEN,KLEUR1,KLEUR2,KLEUR3...KLEUR10
-```
-
-> Notities i.v.b.m. cache: Repo kaarten hebben een standaard cache van 4 uur (14400 seconden) als de fork hoeveelheid en de star hoeveelheid minder is dan 1k, anders is het 2 uur (7200 seconden). Daarnaast ligt de cache vast aan een minimum van 2 uur en een maximum van 24 uur.
-
-#### Exclusieve opties voor Statistieken Kaart:
-
-- `hide` - Verbergt gespecificeerde items van de statistieken. _(komma gescheiden waardes)_
-- `hide_title` - _(boolean)_
-- `hide_rank` - _(boolean)_
-- `show_icons` - _(boolean)_
-- `include_all_commits` - Tel alle commits inplaats van alleen de commits van het huidige jaar _(boolean)_
-- `count_private` - Tel privé commits mee _(boolean)_
-- `line_height` - Stel de lijn-hoogte tussen text in _(nummer)_
-- `custom_title` - Stel een aangepaste titel voor je kaart in
-
-#### Exclusieve opties voor Repo Kaart:
-
-- `show_owner` - Laat de eigenaar van de repo zien _(boolean)_
-
-#### Exclusieve opties voor Programmeertaal Kaart:
-
-- `hide` - Verbergt specifieke talen van de kaart _(komma gescheiden waardes)_
-- `hide_title` - _(boolean)_
-- `layout` - Kies uit de vijf beschikbare lay-outs `normal` & `compact` & `donut` & `donut-vertical` & `pie`
-- `card_width` - Stelt de breedte van de kaart handmatig in. _(nummer)_
-- `langs_count` - Laat meer talen op de kaart zien, waarde tussen 1-10, staat standaard op to 5 _(nummer)_
-- `exclude_repo` - Verbergt specifieke repositories _(komma gescheiden waardes)_
-- `custom_title` - Stelt een eigen titel voor de kaart in
-
-> :Waarschuwing: **Belangrijk:**
-> Namen van programmeertalen moeten worden geuri-escaped, zoals gespecificeerd in [Percent Encoding](https://en.wikipedia.org/wiki/Percent-encoding)
-> (Oftewel: `c++` moet `c%2B%2B` worden, `jupyter notebook` moet `jupyter%20notebook` worden, enzovoort...)
-> Zie [urlencoder.org](https://www.urlencoder.org/) om dit automatisch te doen.
-
-#### Exclusieve opties voor WakaTime Kaart:
-
-- `hide_title` - _(boolean)_
-- `line_height` - Verandert de lijn hoogte tussen tekst _(nummer)_
-- `hide_progress` - Verbergt de progressiebalk en het percentage _(boolean)_
-- `custom_title` - Stelt een eigen titel voor de kaart in
-- `layout` - Schakel tussen de twee beschikbare lay-outs `default` en `compact`
-
----
-
-# GitHub Extra Pins
-
-GitHub extra pins geven je de mogelijkheid om meer dan 6 repositories op je profiel te pinnen, doormiddel van een GitHub readme profile.
-
-Joepie! Je bent niet langer aan 6 pins gelimiteerd!
-
-### Gebruik
-
-Kopieer en plak deze code in je readme en verander de links.
-
-Eindpunt: `api/pin?username=anuraghazra&repo=github-readme-stats`
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Demo
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-Gebruikt [show_owner](#customization) variabele om de repo\'s eigenaar toe te voegen
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-# Top Programmeertalen Kaart
-
-De top programmeertalen kaart laat zien welke talen een GitHub gebruiker het meest gebruikt.
-
-_Notitie: Top programmeertalen wijzen niet op een vaardigheids niveau, het is puur een GitHub metriek over welke talen de meeste code op GitHub hebben. Het is een nieuwe funktie van github-readme-stats._
-
-### Gebruik
-
-Kopieer en plak deze code in je readme en verander de links.
-
-
-Eindpunt: `api/top-langs?username=anuraghazra`
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Verberg individueele repositories
-
-Je kan de parameter `?exclude_repo=repo1,repo2` gebruiken om individueele repositories te verbergen.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Verberg individueele talen
-
-Je kan de `?hide=taal1,taal2` parameter gebruiken om individuele programmeer talen te verbergen.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Laat meer programmeertalen zien
-
-Je kan de `&langs_count=` optie gebruiken om de hoeveelheid talen op je kaart groter en kleiner te maken. Geldige waardes zijn tussen de 1 en 10 (inclusief), en de standaard waarde is 5.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Compacte Talen Kaart opmaak
-
-Je kan de `&layout=compact` optie gebruiken om het kaart ontwerp aan te passen.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Demo
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-- Compacte opmaak
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-# Wekelijkse WakaTime Statistieken
-
-Verander de `?username=` waarde naar je [WakaTime](https://wakatime.com) gebruikersnaam.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Demo
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
----
-
-### Alle demos
-
-- Standaard
-
-
-
-- Verberg specifieke statestieken
-
-
-
-- Weergeef icoontjes
-
-
-
-- Voeg alle commits toe
-
-
-
-- Thema\'s
-
-Kies uit de [standaard thema\'s](#themes)
-
-
-
-- Kleurenverloop
-
-
-
-- Pas statistieken kaart aan
-
-
-
-- Stel je kaart locale (taal) in
-
-
-
-- Pas repo kaart aan.
-
-
-
-- Top programmeertalen
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-- WakaTime kaart
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
----
-
-### Kleine tip (Verstel de repo kaart z\'n positie)
-
-Meestal kan je de afbeeldingen niet naast elkaar zetten, op deze manier wel:
-
-```html
-
-
-
-
-
-
-```
-
-## Deploy je eigen Vercel instatie
-
-#### [Check de stapsgewijze video tutorial door @codeSTACKr (In het Engels)](https://youtu.be/n6d4KHSKqGk?t=107)
-
-Sinds de GitHub API alleen maar 5k verzoeken per uur toestaat, zou mijn `https://github-readme-stats.vercel.app/api` mogelijk de rate limiet behalen. Als je het op je eigen Vercel server host, dan hoef je je nergens zorgen om te maken. Klik op de deploy knop om te beginnen!
-
-NOTITIE: Sinds [#58](https://github.com/anuraghazra/github-readme-stats/pull/58) zouden we geen problemen meer moeten hebben de 5k verzoeken per uur, en verdere downtime :D
-
-[](https://vercel.com/import/project?template=https://github.com/anuraghazra/github-readme-stats)
-
-
- Versel deploy gids: 🔨
-
-1. Ga naar [vercel.com](https://vercel.com/)
-2. Klik op `Log in`
- 
-3. Meld je aan met GitHub door op `Continue with GitHub` te klikken.
- 
-4. Log in op GitHub en sta toegang tot alle repositories toe, wanneer dat gevraagt wordt.
-5. Fork deze repo
-6. Ga terug naar je [Vercel dashboard](https://vercel.com/dashboard)
-7. Selecteer `Import Project`
- 
-8. Selecteer `Import Git Repository`
- 
-9. Selecteer root en hou alles zoals het is, voeg alleen je environment variable genaamd PAT_1 toe (Zoals hier late zien word), die beheert over een persoonlijke toegangs token (PAT), die je gemakklijk [hier](https://github.com/settings/tokens/new) gemakkelijk kan creeëren. (Laat alles zoals het is, noem het maar iets, mag alles zijn.)
- 
-10. Klik deploy, en alles zou moeten werken. Zie je domein om de api te gebruiken!
-
-
-
-## :sparkling_heart: Ondersteun het project
-
-Ik maak bijna alles open-source wat ik kan, en ik probeer iedereen te helpen die deze projecten gebruiken. Natuurlijk kost dit tijd, je mag deze services gratis gebruiken.
-
-Hoe dan ook, als je dit project gebruikt en er blij mee bent, of mij wilt aanmoedigen om dingen te blijven maken, zijn er een paar manieren om dit te doen; -
-
-- Credits geven aan github-readme-stats op je readme, die terug naar het project linkt :D
-- Sterren en delen van het project :rocket:
-- [](https://www.paypal.me/anuraghazra) - Je kan eenmalig giften via PayPal, ik koop er waarschijnlijk ~~koffie~~ thee van. :tea:
-
-Bedankt! :heart:
-
----
-
-[](https://vercel.com?utm_source=github_readme_stats_team&utm_campaign=oss)
-
-Contributies zijn welkom! <3
-
-Gemaakt met :heart: en JavaScript.
diff --git a/docs/readme_np.md b/docs/readme_np.md
deleted file mode 100644
index f5909ae718219..0000000000000
--- a/docs/readme_np.md
+++ /dev/null
@@ -1,422 +0,0 @@
-
परियोजना मनपर्यो? तपाईं मद्दत गर्न सक्नुहुन्छ यो परियोजना बढ्न
-
-# विशेषताहरु
-
-- [गितहब स्टेट कार्ड](#गितहब-स्टेट-कार्ड)
- - [लुकाउनु होस् व्यक्तिगत स्टेट](#लुकाउनु-होस्-व्यक्तिगत-स्टेट)
- - [जोड्नु होस् निजी टोटल योगदान](#जोड्नु-होस्-निजी-टोटल--योगदान)
- - [देखाउनु होस् इकोन](#देखाउनु-होस्-इकोन)
- - [विषयवस्तुहरू](#विषयवस्तुहरू)
- - [अनुकूलन](#अनुकूलन)
-- [गितहब अतिरिक्त पिन्स](#गितहब-अतिरिक्त-पिन्स)
- - [प्रयोग](#प्रयोग)
- - [डेमो](#डेमो)
-- [टोप भाषा कार्ड](#टोप-भाषा-कार्ड)
- - [प्रयोग](#प्रयोग-1)
- - [Exclude individual repositories](#exclude-individual-repositories)
- - [कुनै भाषा चुपौनॆ तरिका](#कुनै-भाषा-चुपौनॆ-तरिका)
- - [धेरॆ भाषाहरु हेर्नको लागि](#धेरॆ-भाषाहरु-हेर्नको-लागि)
- - [कम्प्याक्ट भाषा कार्ड ळयोउत](#कम्प्याक्ट-भाषा-कार्ड-ळयोउत)
- - [डेमो](#डेमो-1)
-- [वाका समय वीक स्तट्स](#वाका-समय-वीक-स्तट्स)
- - [डेमो](#डेमो-2)
- - [सबै डेमोहरु](#सबै-डेमोहरु)
- - [टिप् (रेपो कार्डलाए अलिग्न गर्ने )](#टिप्--रेपो-कार्डलाए-अलिग्न-गर्ने-)
- - [देप्लोय आफ्नै वेर्चेल इन्स्तंस](#देप्लोय--आफ्नै--वेर्चेल--इन्स्तंस)
- - [:sparkling\_heart: सहपोर्ट द प्रोजेक्ट](#sparkling_heart-सहपोर्ट-द-प्रोजेक्ट)
-
-# गितहब स्टेट कार्ड
-
-Copy-paste this into your markdown content, and that's it. Simple!
-
-Change the `?username=` value to your GitHub's username.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-_Note: Ranks are calculated based on user's stats, see [src/calculateRank.js](./src/calculateRank.js)_
-
-### लुकाउनु होस् व्यक्तिगत स्टेट
-
-To hide any specific stats, you can pass a query parameter `?hide=` with comma-separated values.
-
-> Options: `&hide=stars,commits,prs,issues,contribs`
-
-```md
-
-```
-
-### जोड्नु होस् निजी टोटल योगदान
-
-You can add the count of all your private contributions to the total commits count by using the query parameter `?count_private=true`.
-
-_Note: If you are deploying this project yourself, the private contributions will be counted by default otherwise you need to chose to share your private contribution counts._
-
-> Options: `&count_private=true`
-
-```md
-
-```
-
-### देखाउनु होस् इकोन
-
-To enable icons, you can pass `show_icons=true` in the query param, like so:
-
-```md
-
-```
-
-### विषयवस्तुहरू
-
-With inbuilt themes, you can customize the look of the card without doing any [manual customization](#customization).
-
-Use `?theme=THEME_NAME` parameter like so :-
-
-```md
-
-```
-
-#### सबै इनबिल्ट विषयवस्तु :-
-
-dark, radical, merko, gruvbox, tokyonight, onedark, cobalt, synthwave, highcontrast, dracula
-
-
-
-
-तपैले सबै थेम्सहरु प्रेविउ गर्न सक्नु हुनेछ । [all available themes](./themes/README.md) नत्र थेम्सहरुको config [theme config file](./themes/index.js) पनि हेर्न सक्नु हुनेछ र **थेम्सहरुमा योगदान पनि गर्नु सक्नु हुनेछ** :D ।
-
-### अनुकूलन
-
-तपैले `Stats Card` or `Repo Card` को अपपेअरंस कस्टमेज गर्न सक्नु हुनेछ जसमा तपैले URL params पनि प्रयोग गर्नु सक्नु हुनेछ ।
-
-#### साधारण विकल्पहरू:
-
-- `title_color` - Card's title color _(hex color)_
-- `text_color` - Body text color _(hex color)_
-- `icon_color` - Icons color if available _(hex color)_
-- `bg_color` - Card's background color _(hex color)_ **or** a gradient in the form of _angle,start,end_
-- `hide_border` - Hides the card's border _(boolean)_
-- `theme` - name of the theme, choose from [all available themes](./themes/README.md)
-- `cache_seconds` - set the cache header manually _(min: 14400, max: 86400)_
-- `locale` - set the language in the card _(e.g. cn, de, es, etc.)_
-
-##### Gradient in bg_color
-
-You can provide multiple comma-separated values in bg_color option to render a gradient, the format of the gradient is :-
-
-```
-&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
-
-#### Stats कार्ड विशेष विकल्पहरू:
-
-- `hide` - Hides the specified items from stats _(Comma-separated values)_
-- `hide_title` - _(boolean)_
-- `hide_rank` - _(boolean)_
-- `show_icons` - _(boolean)_
-- `include_all_commits` - Count total commits instead of just the current year commits _(boolean)_
-- `count_private` - Count private commits _(boolean)_
-- `line_height` - Sets the line-height between text _(number)_
-- `custom_title` - Sets a custom title for the card
-
-#### Repo कार्ड विशेष विकल्पहरू:
-
-- `show_owner` - Show the owner name of the repo _(boolean)_
-
-#### भाषा कार्ड अनन्य विकल्पहरू :
-
-- `hide` - Hide the languages specified from the card _(Comma-separated values)_
-- `hide_title` - _(boolean)_
-- `layout` - Switch between five available layouts `normal` & `compact` & `donut` & `donut-vertical` & `pie`. Default: `normal`.
-- `card_width` - Set the card's width manually _(number)_
-- `langs_count` - Show more languages on the card, between 1-10, defaults to 5 _(number)_
-- `exclude_repo` - Exclude specified repositories _(Comma-separated values)_
-- `custom_title` - Sets a custom title for the card
-
-> :warning: **Important:**
-> 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.)
-
-#### वकासमय कार्ड विशेष विकल्प:
-
-- `hide_title` - _(boolean)_
-- `line_height` - Sets the line-height between text _(number)_
-- `hide_progress` - Hides the progress bar and percentage _(boolean)_
-- `custom_title` - Sets a custom title for the card
-
----
-
-# गितहब अतिरिक्त पिन्स
-
-GitHub extra pins allow you to pin more than 6 repositories in your profile using a GitHub readme profile.
-
-GitHub फाल्तु पिनले तपाइँलाए GitHub रीडमी प्रोफाइल प्रयोग गरी तपाइँको प्रोफाइलमा छ ओटा भन्दा बढि प्रोजेक्टहरु पिन गर्न अनुमति दिन्छ ।
-
-हो! तपाईं अब pin पिन गरीएको छ ओटा प्रोजेक्ट सीमित हुनुहुन्छ ।
-
-### प्रयोग
-
-कोदलाए कपी- पेसेत readme मा गर्नु होला र लिंक परिवतन गर्नु होला |
-
-Endpoint: `api/pin?username=anuraghazra&repo=github-readme-stats`
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### डेमो
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-Use [show_owner](#customization) variable to include the repo's owner username
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-# टोप भाषा कार्ड
-
-टोप भाषाकार्डले github परयोग गर्नेहरुको प्रोग्रम्मिंग भाषाहरु देखाऊने गर्दछ |.
-
-_NOTE: टोप भाषाहरुले आफ्नो सिपलाए संकेत गरेको होईन | योचै GitHub Metricबाट धेरै कुन भाषा परयोग भाकोलाए संकेत गरेको हो |
-### प्रयोग
-
-कोदलाए कपी- पेसेत readme मा गर्नु होला र लिंक परिवतन गर्नु होला |
-
-Endpoint: `api/top-langs?username=anuraghazra`
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Exclude individual repositories
-
-You can use `?exclude_repo=repo1,repo2` parameter to exclude individual repositories.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### कुनै भाषा चुपौनॆ तरिका
-
-You can use `?hide=language1,language2` parameter to hide individual languages.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### धेरॆ भाषाहरु हेर्नको लागि
-
-You can use the `&langs_count=` option to increase or decrease the number of languages shown on the card. Valid values are integers between 1 and 10 (inclusive), and the default is 5.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### कम्प्याक्ट भाषा कार्ड ळयोउत
-
-तपाइले `&layout=compact` ओप्तिओनपनि कार्ड देसिग्न को लागि परहयोग गर्न सक्नु हुन्क्ष
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### डेमो
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-- Compact layout
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-# वाका समय वीक स्तट्स
-
-Change the `?username=` value to your [WakaTime](https://wakatime.com) username.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### डेमो
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
----
-
-### सबै डेमोहरु
-
-- देफौल्ट
-
-
-
-- हिदिंग स्पेचific स्तट्स
-
-
-
-- इकोनहरु शो गर्ने
-
-
-
-- सबै कमितहरु
-
-
-
-- थेम्स
-
-कुनै एउटा चोज गर्नुस [default themes](#themes)
-
-
-
-- घ्रदिएन्त
-
-
-
-- स्तत्स कार्ड लाए कस्तोमेज गर्ने
-
-
-
-- सेत्तिंग कार्ड लोचले
-
-
-
-- रेपो कार्डलाई एडित गर्नु
-
-
-
-- टोप भाषा
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-- वक समय कार्ड
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
----
-
-### टिप् (रेपो कार्डलाए अलिग्न गर्ने )
-
-तपाइले इमेजलाई सइद बय सइद अलीग्न गर्न सक्नु हुदैन तेसैले येसरी गर्नु होस् :
-
-```html
-
-
-
-
-
-
-```
-
-## देप्लोय आफ्नै वेर्चेल इन्स्तंस
-
-#### [Check Out Step By Step Video Tutorial By @codeSTACKr](https://youtu.be/n6d4KHSKqGk?t=107)
-
-गितहब को अपिएले पाच हजार रेक़ुएस्त प्रति घण्टा मात्र मिल्क्ष । मेरो
- `https://github-readme-stats.vercel.app/api` प्रोजेक्ट मा रेत् लिमिट हुन सक्क्ष । तर तपाइले आफ्नै वेर्चेल सेर्वेर मा होस्ट गर्नु बाको छ बने यो प्रोब्लेम हुदैन।
- होस्ट गर्ने तरिका यस पकारका षन ।
-
-NOTE: Since [#58](https://github.com/anuraghazra/github-readme-stats/pull/58) we should be able to handle more than 5k requests and have no issues with downtime :D
-
-[](https://vercel.com/import/project?template=https://github.com/anuraghazra/github-readme-stats)
-
-
- Guide on setting up Vercel 🔨
-
-1. Go to [vercel.com](https://vercel.com/)
-1. Click on `Log in`
- 
-1. Sign in with GitHub by pressing `Continue with GitHub`
- 
-1. Sign into GitHub and allow access to all repositories, if prompted
-1. Fork this repo
-1. Go back to your [Vercel dashboard](https://vercel.com/dashboard)
-1. Select `Import Project`
- 
-1. Select `Import Git Repository`
- 
-1. Select root and keep everything as is, just add your environment variable named PAT_1 (as shown), which will contain a personal access token (PAT), which you can easily create [here](https://github.com/settings/tokens/new) (leave everything as is, just name it something, it can be anything you want)
- 
-1. Click deploy, and you're good to go. See your domains to use the API!
-
-
-
-## :sparkling_heart: सहपोर्ट द प्रोजेक्ट
-
-म सके सम्म आफ्नो प्रोजेक्ट हरु ओपेन्सोउर्चे गर्छु र अरु ले पनि सहयोग गर्क्षु । मेले सहयोग गर्दा आफ्नो समय पनि देरै ने दिन्क्षु । तपाइहरु ले यो सेर्विचेस फ्री मा चलाउनु सक्नु हुनेक्ष ।
-
-येदि तपाइले यो प्रोजेक्ट चलाउनु बाकोक्ष बने र मलाई अझै प्रसंसा गर्ने हो बने तपाइले थुप्रै तरिका ले गर्नु सक्नु हुने छ :-
-
-- यो प्रोजेक्टमा तपाइले प्रहयोग गर्दा मलाई क्रेडिट दिन सक्नु हुनेक्ष ।
-- तपाइले GitHub ReadMe Stats स्तार्रेड गर्न सक्नु हुनेक्ष :rocket:
-- [](https://www.paypal.me/anuraghazra) - तपाइले पेपाल बाट पनि सहयोग (डक्क्षिन) गर्न सक्नु हुनेक्ष | म ~~कोफी ~~ चिया . :tea: किन्न सक्क्षु ।
-
-धन्याबाद! :heart:
-
----
-
-
-
-योगधन को लागी स्वगत छ! <3
-
-जाभास्क्रिप्ट बाटा बनको :heart:
diff --git a/docs/readme_pt-BR.md b/docs/readme_pt-BR.md
deleted file mode 100644
index 35c334131ee93..0000000000000
--- a/docs/readme_pt-BR.md
+++ /dev/null
@@ -1,372 +0,0 @@
-
-
-
GitHub Readme Stats
-
Adicione suas estatísticas no GitHub geradas dinamicamente em seus readmes!
Gostou do projeto? Por favor considere fazer uma doação para ajudar a melhorá-lo!
-
-# Características
-
-- [Cartão de estatísticas do GitHub](#cartão-de-estatísticas-do-github)
- - [Ocultando estatísticas específicas](#ocultando-estatísticas-específicas)
- - [Adicionando contagem de contribuições privadas à contagem total de commits](#adicionando-contagem-de-contribuições-privadas-à-contagem-total-de-commits)
- - [Exibindo ícones](#exibindo-ícones)
- - [Temas](#temas)
- - [Personalização](#personalização)
-- [Pins extras do GitHub](#pins-extras-do-github)
- - [Utilização](#utilização)
- - [Demonstração](#demonstração)
-- [Cartão de principais linguagens de programação](#cartão-de-principais-linguagens-de-programação)
- - [Utilização](#utilização-1)
- - [Ocultar linguagens individualmente](#ocultar-linguagens-individualmente)
- - [Layout de cartão de linguagens compacto](#layout-de-cartão-de-linguagens-compacto)
- - [Demonstração](#demonstração-1)
-- [Estatística semanal WakaTime](#estatística-semanal-wakatime)
- - [Demonstração](#demonstração-2)
- - [Todas as demonstrações](#todas-as-demonstrações)
- - [Dica (Alinhandos os cartões de repositório)](#dica-alinhandos-os-cartões-de-repositório)
- - [Implante em sua própria instância do Vercel](#implante-em-sua-própria-instância-do-vercel)
- - [:sparkling\_heart: Apoie o projeto](#sparkling_heart-apoie-o-projeto)
-
-# Cartão de estatísticas do GitHub
-
-Copie e cole isso no seu conteúdo de remarcação e é isso. Simples!
-
-Mude o valor de `?username=` para o seu nome de usuário no GitHub.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-_Nota: As classificações são baseadas nas estatísticas do usuário, veja [src/calculateRank.js](../src/calculateRank.js)_
-
-### Ocultando estatísticas específicas
-
-Para ocultar estatísticas individualmente, você pode passar um parâmetro de consulta `?hide=` com valores separados por vírgula.
-
-> Opções: `&hide=stars,commits,prs,issues,contribs`
-
-```md
-
-```
-
-### Adicionando contagem de contribuições privadas à contagem total de commits
-
-Adicione a contagem de todas as suas contribuições privadas à contagem total de confirmações usando o parâmetro de consulta `?count_private=true`.
-
-_Nota: Se você estiver implantando este projeto, as contribuições privadas serão contadas por padrão; caso contrário, você precisará compartilhar suas contagens de contribuições privadas._
-
-> Opções: `&count_private=true`
-
-```md
-
-```
-
-### Exibindo ícones
-
-Para habilitar ícones, basta utilizar o parâmetro `show_icons=true` na sua requisição, da seguinte forma:
-
-```md
-
-```
-
-### Temas
-
-Com temas predefinidos, pode personalizar a aparência dos cartões sem precisar fazer nenhuma [configuração manual](#personalização).
-
-Utilize o parâmetro `?theme=THEME_NAME`, da seguinte forma:
-
-```md
-
-```
-
-#### Todos os temas predefinidos :
-
-dark, radical, merko, gruvbox, tokyonight, onedark, cobalt, synthwave, highcontrast, dracula
-
-
-
-Visualize [todos o temas disponíveis](../themes/README.md) ou o [arquivo de configuração de tema](../themes/index.js), além de **também poder contribuir com novos temas**, se desejar :D
-
-### Personalização
-
-Personalize a aparência do seu `Stats Card` ou `Repo Card` da maneira que desejar com os parâmetros de URL.
-
-#### Opções comuns
-
-- `title_color` - Cor do título do cartão _(hex color)_
-- `text_color` - Cor de texto do conteúdo _(hex color)_
-- `icon_color` - Cor dos ícones (se disponível) _(hex color)_
-- `bg_color` - Cor de fundo do cartão _(hex color)_
-- `hide_border` - Esconde a borda do cartão _(boleano)_
-- `theme` - Nome do tema, escolha em [todos os temas disponíveis](../themes/README.md)
-- `cache_seconds` - Defina o cabeçalho do cache manualmente _(min: 14400, max: 86400)_
-- `locale` - defina o idioma no cartão _(por exemplo. cn, de, es, etc.)_
-
-> Nota sobre o cache: Cartões de repositório tem um cache padrão de 30 minutos (1800 segundos), se o número a contagem de forks e contagem de estrelas é menor que 1 mil o padrão é 2 horas (7200 segundos). Note também que o cache é limitado a um mínimo de 30 minutos e um máximo de 24 horas.
-
-#### Opções exclusivas do cartão de estatísticas:
-
-- `hide` - Oculta itens específicos das estatísticas _(Valores separados por vírgulas)_
-- `hide_title` - Ocultar o título _(boolean)_
-- `hide_rank` - Ocultar a classificação _(boolean)_
-- `show_icons` - Mostrar ícones _(boolean)_
-- `include_all_commits` - Contabiliza todos os commits ao invés de apenas os atual ano _(boolean)_
-- `count_private` - Contabiliza commits privados _(boolean)_
-- `line_height` - Define a altura do espaçamento entre o texto _(number)_
-
-#### Opções exclusivas do cartão de repositórios:
-
-- `show_owner` - Exibir o nome da pessoa a quem o repositório pertence _(boolean)_
-
-#### Opções exclusivas do cartão de linguagens:
-
-- `hide` - Oculta linguagens específicas _(Valores separados por vírgulas)_
-- `hide_title` - Oculta o título _(boolean)_
-- `layout` - Alternar entre os cinco layouts disponíveis `normal` & `compact` & `donut` & `donut-vertical` & `pie`
-- `card_width` - Define a largura do cartão manualmente _(number)_
-
-> :warning: **Importante:**
-> Nomes de linguagens devem ser uma sequência escapada de URI, como específicado em [Codificação por cento](https://pt.wikipedia.org/wiki/Codificação_por_cento)
-> (Ou seja: `c++` deve se tornar `c%2B%2B`, `jupyter notebook` deve se tornar `jupyter%20notebook`, etc.)
-
----
-
-# Pins extras do GitHub
-
-Os Pins extras do GitHub permitem fixar mais de 6 repositórios no seu perfil usando um perfil README.me do GitHub.
-
-Uhu! Você não está mais limitado a 6 repositórios fixados.
-
-### Utilização
-
-Copie e cole esse código no seu README.md e altere os atributos.
-
-Endpoint: `api/pin?username=anuraghazra&repo=github-readme-stats`
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Demonstração
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-Utilize a variável [show_owner](#personalização) para incluir o nome de usuário do proprietária do repositório
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-# Cartão de principais linguagens de programação
-
-Exibe uma métrica de linguagens de programação mais usadas pelo usuário do GitHub.
-
-_Nota: As principais linguagens de programação não fazem declarações sobre habilidades pessoais ou similares, é apenas uma figura-chave com base nas estatísticas do GitHub do usuário indicando a frequência com que cada uma foi utilizada._
-
-### Utilização
-
-Copie e cole esse código no seu README.md e altere os atributos.
-
-Endpoint: `api/top-langs?username=anuraghazra`
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Ocultar linguagens individualmente
-
-Utilize o parâmetro `?hide=language1,language2` para ocultar linguagens específicas.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Layout de cartão de linguagens compacto
-
-Utilize a opção `&layout=compact` para mudar o layout do cartão.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Demonstração
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-- Layout compacto
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-# Estatística semanal WakaTime
-
-Altere o valor de `?username=` para o seu username do WakaTime.
-
-```md
-[](https://github.com/anuraghazra/github-readme-stats)
-```
-
-### Demonstração
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
----
-
-
-
-### Todas as demonstrações
-
-- Padronizado
-
-
-
-- Ocultando estatísticas específicas
-
-
-
-- Mostrando ícones
-
-
-
-- Incluir todos os commits
-
-
-
-- Temas
-
-Escolha entre um dos [temas predefinidos](#temas)
-
-
-
-- Personalizando o cartão de estatísticas
-
-
-
-- Customizando o cartão de repositório
-
-
-
-- Principais linguagens
-
-[](https://github.com/anuraghazra/github-readme-stats)
-
----
-
-### Dica (Alinhandos os cartões de repositório)
-
-Por padrão, você não poderá organizar as imagens lado a lado. Para fazer isso, você pode usar a seguinte abordagem:
-
-```html
-
-
-
-
-
-
-```
-
-## Implante em sua própria instância do Vercel
-
-#### [Check Out Step By Step Video Tutorial By @codeSTACKr](https://youtu.be/n6d4KHSKqGk?t=107)
-
-Como a API do GitHub permite apenas 5 mil solicitações por hora, é possível que minha `https://github-readme-stats.vercel.app/api` atinja a cota limite. Se hospedar em seu próprio servidor Vercel, não precisará se preocupar com nada. Clique no botão de implantação para começar!
-
-Nota: Desde [#58](https://github.com/anuraghazra/github-readme-stats/pull/58) há possibilidade de lidar com mais de 5 mil chamadas por hora, sem interrupções :D
-
-[](https://vercel.com/import/project?template=https://github.com/anuraghazra/github-readme-stats)
-
-
- Guia de configuração do Vercel
-
-1. Acesse [vercel.com](https://vercel.com/)
-1. Clique em `Login`
- 
-1. Acesse com o GitHub clicando em `Continue with GitHub`
- 
-1. Entre no GitHub e permita acesso a todos os repositórios, se solicitado
-1. Faça Fork neste repositório
-1. Volte ao seu [painel principal do Vercel](https://vercel.com/dashboard)
-1. Selecione `Import Project`
- 
-1. Selecione `Import Git Repository`
- 
-1. Selecione a raiz e mantenha tudo como está, basta adicionar sua variável de ambiente chamada PAT_1 (que será exibida), que conterá um token de acesso pessoal (PAT), que você pode criar facilmente [aqui](https://github.com/settings/tokens/new) (deixe tudo como está, apenas dê um nome, que pode ser o que você quiser)
- 
-1. Clique em `deploy` e já estará tudo pronto. Veja seus domínios para usar a API!
-
-
-
-## :sparkling_heart: Apoie o projeto
-
-Disponibilizo como código aberto quase tudo o que posso e tento responder a todos que precisam de ajuda para utilizar esses projetos. Claro,
-isso demanda tempo. Utilize este serviço gratuitamente.
-
-No entanto, se você utilizar este projeto e estiver satisfeito com ele, ou apenas quiser me encorajar a continuar criando coisas, existem algumas formas fazê-lo:
-
-- Dando os devidos créditos ao usar github-readme-stats no seu README.me, adicionando uma referência ao projeto :D
-- Dando uma estrela (Starring) e compartilhando o projeto 🚀
-- [](https://www.paypal.me/anuraghazra) - Você pode fazer doações únicas via PayPal. Provavelmente vou comprar um ~~café~~ chá. :tea:
-
-Obrigado! :heart:
-
----
-
-[](https://vercel.com?utm_source=github_readme_stats_team&utm_campaign=oss)
-
-Contribuições são bem-vindas! <3
-
-Feito com :heart: e JavaScript.
diff --git a/docs/readme_tr.md b/docs/readme_tr.md
deleted file mode 100644
index f654cd95cf252..0000000000000
--- a/docs/readme_tr.md
+++ /dev/null
@@ -1,432 +0,0 @@
-
-
-
GitHub Readme Stats
-
Readme'lerinizde dinamik olarak oluşturulmuş GitHub istatistikleri alın!
Please note that documentation translations may be outdated; try to use English documentation if possible.
Love the project? Please consider donating to help it improve!
-
-
-
-
-Are you considering supporting the project by donating to me? Please DO NOT!!!
-
-
-
-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:
-
-
-
-# Features
+
+Table of contents (Click to show)
- [GitHub Stats Card](#github-stats-card)
- [Hiding individual stats](#hiding-individual-stats)
- [Showing additional individual stats](#showing-additional-individual-stats)
- [Showing icons](#showing-icons)
+ - [Showing commits count for specified year](#showing-commits-count-for-specified-year)
- [Themes](#themes)
- [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)
@@ -108,27 +75,35 @@ Please visit [this link](https://give.do/fundraisers/stand-beside-the-victims-of
- [Donut Vertical Chart Language Card Layout](#donut-vertical-chart-language-card-layout)
- [Pie Chart Language Card Layout](#pie-chart-language-card-layout)
- [Hide Progress Bars](#hide-progress-bars)
+ - [Change format of language's stats](#change-format-of-languages-stats)
- [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)
+ - [GitHub Actions (Recommended)](#github-actions-recommended)
+ - [Self-hosted (Vercel/Other) (Recommended)](#self-hosted-vercelother-recommended)
+ - [First step: get your Personal Access Token (PAT)](#first-step-get-your-personal-access-token-pat)
+ - [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)
- - [On other platforms](#on-other-platforms)
- - [Disable rate limit protections](#disable-rate-limit-protections)
+ - [On other platforms](#on-other-platforms)
+ - [Available environment variables](#available-environment-variables)
- [Keep your fork up to date](#keep-your-fork-up-to-date)
- [:sparkling\_heart: Support the project](#sparkling_heart-support-the-project)
+
# Important Notices
-> [!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).
+> [!IMPORTANT]
+> The public Vercel instance at `https://github-readme-stats.vercel.app/api` is best-effort and can be unreliable due to rate limits and traffic spikes (see [#1471](https://github.com/anuraghazra/github-readme-stats/issues/1471)). We use caching to improve stability (see [common options](#common-options)), but for reliable cards we recommend [self-hosting](#deploy-on-your-own) (Vercel or other) or using the [GitHub Actions workflow](#github-actions-recommended) to generate cards in your [profile repository](https://docs.github.com/en/account-and-profile/how-tos/profile-customization/managing-your-profile-readme).
-> [!IMPORTANT]\
+> [!IMPORTANT]
> We're a small team, and to prioritize, we rely on upvotes :+1:. We use the Top Issues dashboard for tracking community demand (see [#1935](https://github.com/anuraghazra/github-readme-stats/issues/1935)). Do not hesitate to upvote the issues and pull requests you are interested in. We will work on the most upvoted first.
# GitHub Stats Card
@@ -141,10 +116,10 @@ Change the `?username=` value to your GitHub username.
[](https://github.com/anuraghazra/github-readme-stats)
```
-> [!WARNING]\
+> [!WARNING]
> By default, the stats card only shows statistics like stars, commits, and pull requests from public repositories. To show private statistics on the stats card, you should [deploy your own instance](#deploy-on-your-own) using your own GitHub API token.
-> [!NOTE]\
+> [!NOTE]
> Available ranks are S (top 1%), A+ (12.5%), A (25%), A- (37.5%), B+ (50%), B (62.5%), B- (75%), C+ (87.5%) and C (everyone). This ranking scheme is based on the [Japanese academic grading](https://wikipedia.org/wiki/Academic_grading_in_Japan) system. The global percentile is calculated as a weighted sum of percentiles for each statistic (number of commits, pull requests, reviews, issues, stars, and followers), based on the cumulative distribution function of the [exponential](https://wikipedia.org/wiki/exponential_distribution) and the [log-normal](https://wikipedia.org/wiki/Log-normal_distribution) distributions. The implementation can be investigated at [src/calculateRank.js](https://github.com/anuraghazra/github-readme-stats/blob/master/src/calculateRank.js). The circle around the rank shows 100 minus the global percentile.
### Hiding individual stats
@@ -175,6 +150,14 @@ To enable icons, you can pass `&show_icons=true` in the query param, like so:

```
+### Showing commits count for specified year
+
+You can specify a year and fetch only the commits that were made in that year by passing `&commits_year=YYYY` to the parameter.
+
+```md
+
+```
+
### Themes
With inbuilt themes, you can customize the look of the card without doing any [manual customization](#customization).
@@ -301,8 +284,8 @@ You can customize the appearance of all your cards however you wish with URL par
| `locale` | Sets the language in the card, you can check full list of available locales [here](#available-locales). | enum | `en` |
| `border_radius` | Corner rounding on the card. | number | `4.5` |
-> [!WARNING]\
-> We use caching to decrease the load on our servers (see ). Our cards have a default cache of 6 hours (21600 seconds). Also, note that the cache is clamped to a minimum of 6 hours and a maximum of 24 hours. If you want the data on your statistics card to be updated more often you can [deploy your own instance](#deploy-on-your-own) and set [environment variable](#disable-rate-limit-protections) `CACHE_SECONDS` to a value of your choosing.
+> [!WARNING]
+> We use caching to decrease the load on our servers (see ). Our cards have the following default cache hours: stats card - 24 hours, top languages card - 144 hours (6 days), pin card - 240 hours (10 days), gist card - 48 hours (2 days), and wakatime card - 24 hours. If you want the data on your cards to be updated more often you can [deploy your own instance](#deploy-on-your-own) and set [environment variable](#available-environment-variables) `CACHE_SECONDS` to a value of your choosing.
##### Gradient in bg\_color
@@ -319,45 +302,62 @@ Here is a list of all available locales:
| Code | Locale |
| --- | --- |
+| `ar` | Arabic |
+| `az` | Azerbaijani |
+| `bn` | Bengali |
+| `bg` | Bulgarian |
+| `my` | Burmese |
+| `ca` | Catalan |
| `cn` | Chinese |
| `zh-tw` | Chinese (Taiwan) |
-| `ar` | Arabic |
| `cs` | Czech |
-| `de` | German |
+| `nl` | Dutch |
| `en` | English |
-| `bn` | Bengali |
-| `es` | Spanish |
+| `fil` | Filipino |
+| `fi` | Finnish |
| `fr` | French |
-| `hu` | Hungarian |
+| `de` | German |
+| `el` | Greek |
@@ -382,59 +382,15 @@ If we don't support your language, please consider contributing! You can find mo
| `disable_animations` | Disables all animations in the card. | boolean | `false` |
| `ring_color` | Color of the rank circle. | string (hex color) | `2f80ed` |
| `number_format` | Switches between two available formats for displaying the card values `short` (i.e. `6.6k`) and `long` (i.e. `6626`). | enum | `short` |
+| `number_precision` | Enforce the number of digits after the decimal point for `short` number format. Must be an integer between 0 and 2. Will be ignored for `long` number format. | integer (0, 1 or 2) | `null` |
| `show` | Shows [additional items](#showing-additional-individual-stats) on stats card (i.e. `reviews`, `discussions_started`, `discussions_answered`, `prs_merged` or `prs_merged_percentage`). | string (comma-separated values) | `null` |
+| `commits_year` | Filters and counts only commits made in the specified year. | integer _(YYYY)_ | ` (one year to date)` |
-> [!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` |
-
-#### Gist Card Exclusive Options
-
-| Name | Description | Type | Default value |
-| --- | --- | --- | --- |
-| `show_owner` | Shows the gist's owner name. | boolean | `false` |
-
-#### Language Card Exclusive Options
+> [!WARNING]
+> Custom title should be URI-escaped, as specified in [Percent Encoding](https://en.wikipedia.org/wiki/Percent-encoding) (i.e: `Anurag's GitHub Stats` should become `Anurag%27s%20GitHub%20Stats`). You can use [urlencoder.org](https://www.urlencoder.org/) to help you do this automatically.
-| 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` |
-| `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` |
+> [!NOTE]
+> When hide\_rank=`true`, the minimum card width is 270 px + the title length and padding.
***
@@ -454,11 +410,20 @@ Endpoint: `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` |
+
### Demo

-Use [show\_owner](#repo-card-exclusive-options) query option to include the repo's owner username
+Use `show_owner` query option to include the repo's owner username

@@ -476,11 +441,19 @@ Endpoint: `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

-Use [show\_owner](#gist-card-exclusive-options) query option to include the gist's owner username
+Use `show_owner` query option to include the gist's owner username

@@ -488,16 +461,16 @@ Use [show\_owner](#gist-card-exclusive-options) query option to include the gist
The top languages card shows a GitHub user's most frequently used languages.
-> [!WARNING]\
+> [!WARNING]
> By default, the language card shows language results only from public repositories. To include languages used in private repositories, you should [deploy your own instance](#deploy-on-your-own) using your own GitHub API token.
-> [!NOTE]\
+> [!NOTE]
> Top Languages does not indicate the user's skill level or anything like that; it's a GitHub metric to determine which languages have the most code on GitHub. It is a new feature of github-readme-stats.
-> [!WARNING]\
+> [!WARNING]
> This card shows language usage only inside your own non-forked repositories, not depending on who the author of the commits is. It does not include your contributions into another users/organizations repositories. Currently there are no way to get this data from GitHub API. If you want this behavior to be improved you can support [this feature request](https://github.com/orgs/community/discussions/18230) created by [@rickstaa](https://github.com/rickstaa) inside GitHub Community.
-> [!WARNING]\
+> [!WARNING]
> Currently this card shows data only about first 100 repositories. This is because GitHub API limitations which cause downtimes of public instances (see [#1471](https://github.com/anuraghazra/github-readme-stats/issues/1471)). In future this behavior will be improved by releasing GitHub action or providing environment variables for user's own instances.
### Usage
@@ -510,6 +483,28 @@ Endpoint: `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` |
+| `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` |
+| `stats_format` | Switches between two available formats for language's stats `percentages` and `bytes`. | enum | `percentages` |
+
+> [!WARNING]
+> Language names and custom title 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`, `Most Used Languages` should become `Most%20Used%20Languages`, 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:
@@ -592,6 +587,15 @@ You can use the `&hide_progress=true` option to hide the percentages and the pro

```
+### Change format of language's stats
+
+You can use the `&stats_format=bytes` option to display the stats in bytes instead of percentage.
+
+```md
+
+```
+
+
### Demo

@@ -616,17 +620,46 @@ You can use the `&hide_progress=true` option to hide the percentages and the pro

+
+* Display bytes instead of percentage
+
+
+
# WakaTime Stats Card
-> [!WARNING]\
+> [!WARNING]
> Please be aware that we currently only show data from WakaTime profiles that are public. You therefore have to make sure that **BOTH** `Display code time publicly` and `Display languages, editors, os, categories publicly` are enabled.
+> [!WARNING]
+> In case you just created a new WakaTime account, then it might take up to 24 hours until your stats will become visible on the WakaTime stats card.
+
Change the `?username=` value to your [WakaTime](https://wakatime.com) username.
```md
[](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` |
+| `card_width` | Sets the card's width manually. | number | `495` |
+| `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` |
+
+> [!WARNING]
+> Custom title should be URI-escaped, as specified in [Percent Encoding](https://en.wikipedia.org/wiki/Percent-encoding) (i.e: `WakaTime Stats` should become `WakaTime%20Stats`). You can use [urlencoder.org](https://www.urlencoder.org/) to help you do this automatically.
+
### Demo

@@ -657,7 +690,7 @@ Change the `?username=` value to your [WakaTime](https://wakatime.com) username.

-* Shows Github logo instead rank level
+* Shows GitHub logo instead rank level

@@ -715,7 +748,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
@@ -726,26 +761,31 @@ By default, GitHub does not lay out the cards side by side. To do that, you can
```
-```html
+
+:eyes: Show example
+
-
+
-
+
-```
-
-:eyes: Show example
+
+### Pinning repositories
+
+```html
-
+
-
+
+```
-***
+
+:eyes: Show example
@@ -756,18 +796,101 @@ By default, GitHub does not lay out the cards side by side. To do that, you can
-# Deploy on your own
+# Deploy on your own (recommended)
+
+Because the public endpoint is [not reliable](#Important-Notices), we recommend self-deployment via GitHub Actions or your own hosted instance. GitHub Actions is the simplest setup with static SVGs stored in your repo but less frequent updates, while self-hosting takes more work and can serve fresher stats (with caching).
+
+## GitHub Actions
+
+GitHub Actions generates static SVGs and avoids per-request API calls. By default it uses `GITHUB_TOKEN` (public stats only), for private stats, set a [PAT](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) as a secret and pass it to the action instead.
-## On Vercel
+Create `/.github/workflows/grs.yml` in your profile repo (`USERNAME/USERNAME`):
+
+```yaml
+name: Update README cards
+
+on:
+ schedule:
+ - cron: "0 3 * * *"
+ workflow_dispatch:
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Generate stats card
+ uses: readme-tools/github-readme-stats-action@v1
+ with:
+ card: stats
+ options: username=${{ github.repository_owner }}&show_icons=true
+ path: profile/stats.svg
+ token: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Commit cards
+ run: |
+ git config user.name "github-actions"
+ git config user.email "github-actions@users.noreply.github.com"
+ git add profile/*.svg
+ git commit -m "Update README cards" || exit 0
+ git push
+```
+
+Then embed from your profile README:
+
+```md
+
+```
+
+See more options and examples in the [GitHub Readme Stats Action README](https://github.com/readme-tools/github-readme-stats-action#readme).
+
+## Self-hosted (Vercel/Other)
+
+Running your own instance avoids public rate limits and gives you full control over caching, tokens, and private stats.
+
+### First step: get your Personal Access Token (PAT)
+
+For deploying your own instance of GitHub Readme Stats, you will need to create a GitHub Personal Access Token (PAT). Below are the steps to create one and the scopes you need to select for both classic and fine-grained tokens.
+
+Selecting the right scopes for your token is important in case you want to display private contributions on your cards.
+
+#### Classic token
+
+* Go to [Account -> Settings -> Developer Settings -> Personal access tokens -> Tokens (classic)](https://github.com/settings/tokens).
+* Click on `Generate new token -> Generate new token (classic)`.
+* Scopes to select:
+ * repo
+ * read:user
+* Click on `Generate token` and copy it.
+
+#### Fine-grained token
+
+> [!WARNING]\
+> This limits the scope to issues in your repositories and includes only public commits.
+
+* Go to [Account -> Settings -> Developer Settings -> Personal access tokens -> Fine-grained tokens](https://github.com/settings/tokens).
+* Click on `Generate new token -> Generate new token`.
+* Select an expiration date
+* Select `All repositories`
+* Scopes to select in `Repository permission`:
+ * Commit statuses: read-only
+ * Contents: read-only
+ * Issues: read-only
+ * Metadata: read-only
+ * Pull requests: read-only
+* Click on `Generate token` and copy it.
+
+### On Vercel
### :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!
-> [!NOTE]\
+> [!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:.
-> [!NOTE]\
+> [!NOTE]
> If you are on the [Pro (i.e. paid)](https://vercel.com/pricing) Vercel plan, the [maxDuration](https://vercel.com/docs/concepts/projects/project-configuration#value-definition) value found in the [vercel.json](https://github.com/anuraghazra/github-readme-stats/blob/master/vercel.json) can be increased when your Vercel instance frequently times out during the card request. You are advised to keep this value lower than `30` seconds to prevent high memory usage.
[](https://vercel.com/import/project?template=https://github.com/anuraghazra/github-readme-stats)
@@ -787,23 +910,23 @@ Since the GitHub API only allows 5k requests per hour, my `https://github-readme

8. Click the `Continue with GitHub` button, search for the required Git Repository and import it by clicking the `Import` button. Alternatively, you can import a Third-Party Git Repository using the `Import Third-Party Git Repository ->` link at the bottom of the page.

-9. Create a personal access token (PAT) [here](https://github.com/settings/tokens/new) and enable the `repo` and `user` permissions (this allows access to see private repo and user stats).
+9. Create a Personal Access Token (PAT) as described in the [previous section](#first-step-get-your-personal-access-token-pat).
10. Add the PAT as an environment variable named `PAT_1` (as shown).

11. Click deploy, and you're good to go. See your domains to use the API!
-## On other platforms
+### On other platforms
-> [!WARNING]\
+> [!WARNING]
> This way of using GRS is not officially supported and was added to cater to some particular use cases where Vercel could not be used (e.g. [#2341](https://github.com/anuraghazra/github-readme-stats/discussions/2341)). The support for this method, therefore, is limited.
:hammer_and_wrench: Step-by-step guide for deploying on other platforms
1. Fork or clone this repo as per your needs
-2. Add `express` to the dependencies section of `package.json`
+2. Move `express` from the devDependencies to the dependencies section of `package.json`
3. Run `npm i` if needed (initial setup)
4. Run `node express.js` to start the server, or set the entry point to `express.js` in `package.json` if you're deploying on a managed service
@@ -811,14 +934,52 @@ Since the GitHub API only allows 5k requests per hour, my `https://github-readme
5. You're done 🎉
-## Disable rate limit protections
+### Available environment variables
-Github Readme Stats contains several Vercel environment variables that can be used to remove the rate limit protections:
+GitHub Readme Stats provides several environment variables that can be used to customize the behavior of your self-hosted instance. These include:
-* `CACHE_SECONDS`: This environment variable takes precedence over our cache minimum and maximum values and can circumvent these values for self-hosted Vercel instances.
+
+
+
+
Name
+
Description
+
Supported values
+
+
+
+
+
CACHE_SECONDS
+
Sets the cache duration in seconds for the generated cards. This variable takes precedence over the default cache timings for the public instance. If this variable is not set, the default cache duration is 24 hours (86,400 seconds).
+
Any positive integer or 0 to disable caching
+
+
+
WHITELIST
+
A comma-separated list of GitHub usernames that are allowed to access your instance. If this variable is not set, all usernames are allowed.
+
Comma-separated GitHub usernames
+
+
+
GIST_WHITELIST
+
A comma-separated list of GitHub Gist IDs that are allowed to be accessed on your instance. If this variable is not set, all Gist IDs are allowed.
+
Comma-separated GitHub Gist IDs
+
+
+
EXCLUDE_REPO
+
A comma-separated list of repositories that will be excluded from stats and top languages cards on your instance. This allows repository exclusion without exposing repository names in public URLs. This enhances privacy for self-hosted instances that include private repositories in stats cards.
+
Comma-separated repository names
+
+
+
FETCH_MULTI_PAGE_STARS
+
Enables fetching all starred repositories for accurate star counts, especially for users with more than 100 repositories. This may increase response times and API points usage, so it is disabled on the public instance.
+
true or false
+
+
+
See [the Vercel documentation](https://vercel.com/docs/concepts/projects/environment-variables) on adding these environment variables to your Vercel instance.
+> [!WARNING]
+> Please remember to redeploy your instance after making any changes to the environment variables so that the updates take effect. The changes will not be applied to the previous deployments.
+
## Keep your fork up to date
You can keep your fork, and thus your private Vercel instance up to date with the upstream using GitHub's [Sync Fork button](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork). You can also use the [pull](https://github.com/wei/pull) package created by [@wei](https://github.com/wei) to automate this process.
@@ -832,7 +993,7 @@ However, if you are using this project and are happy with it or just want to enc
* Giving proper credit when you use github-readme-stats on your readme, linking back to it. :D
* Starring and sharing the project. :rocket:
-* [](https://www.paypal.me/anuraghazra) - You can make a one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:
+* [](https://www.paypal.me/anuraghazra) - You can make a one-time donation via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:
Thanks! :heart:
diff --git a/scripts/generate-theme-doc.js b/scripts/generate-theme-doc.js
index 1716ea6e95122..e7500eeb13113 100644
--- a/scripts/generate-theme-doc.js
+++ b/scripts/generate-theme-doc.js
@@ -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");
diff --git a/scripts/preview-theme.js b/scripts/preview-theme.js
index 0f6de3729daf9..b9e53ffe97aad 100644
--- a/scripts/preview-theme.js
+++ b/scripts/preview-theme.js
@@ -12,7 +12,7 @@ import Hjson from "hjson";
import snakeCase from "lodash.snakecase";
import parse from "parse-diff";
import { inspect } from "util";
-import { isValidHexColor, isValidGradient } from "../src/common/utils.js";
+import { isValidHexColor, isValidGradient } from "../src/common/color.js";
import { themes } from "../themes/index.js";
import { getGithubToken, getRepoInfo } from "./helpers.js";
diff --git a/src/calculateRank.js b/src/calculateRank.js
index 4724d0388c846..a7741985e489e 100644
--- a/src/calculateRank.js
+++ b/src/calculateRank.js
@@ -31,7 +31,7 @@ function log_normal_cdf(x) {
* @param {number} params.repos Total number of repos.
* @param {number} params.stars The number of stars.
* @param {number} params.followers The number of followers.
- * @returns {{level: string, percentile: number}}} The users rank.
+ * @returns {{ level: string, percentile: number }} The users rank.
*/
function calculateRank({
all_commits,
diff --git a/src/cards/gist-card.js b/src/cards/gist.js
similarity index 93%
rename from src/cards/gist-card.js
rename to src/cards/gist.js
index 9e889e74424cd..62910420ad2f5 100644
--- a/src/cards/gist-card.js
+++ b/src/cards/gist.js
@@ -1,18 +1,17 @@
// @ts-check
import {
- getCardColors,
- parseEmojis,
- wrapTextMultiline,
- encodeHTML,
- kFormatter,
measureText,
flexLayout,
iconWithLabel,
createLanguageNode,
-} from "../common/utils.js";
+} from "../common/render.js";
import Card from "../common/Card.js";
+import { getCardColors } from "../common/color.js";
+import { kFormatter, wrapTextMultiline } from "../common/fmt.js";
+import { encodeHTML } from "../common/html.js";
import { icons } from "../common/icons.js";
+import { parseEmojis } from "../common/ops.js";
/** Import language colors.
*
@@ -96,6 +95,7 @@ const renderGistCard = (gistData, options = {}) => {
);
const languageName = language || "Unspecified";
+ // @ts-ignore
const languageColor = languageColors[languageName] || "#858585";
const svgLanguage = createLanguageNode(languageName, languageColor);
diff --git a/src/cards/index.js b/src/cards/index.js
index f2c5fb0e3a143..5ca3a97adff02 100644
--- a/src/cards/index.js
+++ b/src/cards/index.js
@@ -1,4 +1,4 @@
-export { renderRepoCard } from "./repo-card.js";
-export { renderStatsCard } from "./stats-card.js";
-export { renderTopLanguages } from "./top-languages-card.js";
-export { renderWakatimeCard } from "./wakatime-card.js";
+export { renderRepoCard } from "./repo.js";
+export { renderStatsCard } from "./stats.js";
+export { renderTopLanguages } from "./top-languages.js";
+export { renderWakatimeCard } from "./wakatime.js";
diff --git a/src/cards/repo-card.js b/src/cards/repo.js
similarity index 95%
rename from src/cards/repo-card.js
rename to src/cards/repo.js
index bbfda52d47778..a9c2afc38a222 100644
--- a/src/cards/repo-card.js
+++ b/src/cards/repo.js
@@ -1,19 +1,18 @@
// @ts-check
+
import { Card } from "../common/Card.js";
+import { getCardColors } from "../common/color.js";
+import { kFormatter, wrapTextMultiline } from "../common/fmt.js";
+import { encodeHTML } from "../common/html.js";
import { I18n } from "../common/I18n.js";
import { icons } from "../common/icons.js";
+import { clampValue, parseEmojis } from "../common/ops.js";
import {
- encodeHTML,
flexLayout,
- getCardColors,
- kFormatter,
measureText,
- parseEmojis,
- wrapTextMultiline,
iconWithLabel,
createLanguageNode,
- clampValue,
-} from "../common/utils.js";
+} from "../common/render.js";
import { repoCardLocales } from "../translations.js";
const ICON_SIZE = 16;
diff --git a/src/cards/stats-card.js b/src/cards/stats.js
similarity index 77%
rename from src/cards/stats-card.js
rename to src/cards/stats.js
index 5b7f0d268f9bd..6b428d48c34ae 100644
--- a/src/cards/stats-card.js
+++ b/src/cards/stats.js
@@ -1,16 +1,14 @@
// @ts-check
+
import { Card } from "../common/Card.js";
+import { getCardColors } from "../common/color.js";
+import { CustomError } from "../common/error.js";
+import { kFormatter } from "../common/fmt.js";
import { I18n } from "../common/I18n.js";
import { icons, rankIcon } from "../common/icons.js";
-import {
- CustomError,
- clampValue,
- flexLayout,
- getCardColors,
- kFormatter,
- measureText,
-} from "../common/utils.js";
-import { statCardLocales } from "../translations.js";
+import { clampValue } from "../common/ops.js";
+import { flexLayout, measureText } from "../common/render.js";
+import { statCardLocales, wakatimeCardLocales } from "../translations.js";
const CARD_MIN_WIDTH = 287;
const CARD_DEFAULT_WIDTH = 287;
@@ -19,20 +17,55 @@ const RANK_CARD_DEFAULT_WIDTH = 450;
const RANK_ONLY_CARD_MIN_WIDTH = 290;
const RANK_ONLY_CARD_DEFAULT_WIDTH = 290;
+/**
+ * Long locales that need more space for text. Keep sorted alphabetically.
+ *
+ * @type {(keyof typeof wakatimeCardLocales["wakatimecard.title"])[]}
+ */
+const LONG_LOCALES = [
+ "az",
+ "bg",
+ "cs",
+ "de",
+ "el",
+ "es",
+ "fil",
+ "fi",
+ "fr",
+ "hu",
+ "id",
+ "ja",
+ "ml",
+ "my",
+ "nl",
+ "pl",
+ "pt-br",
+ "pt-pt",
+ "ru",
+ "sr",
+ "sr-latn",
+ "sw",
+ "ta",
+ "uk-ua",
+ "uz",
+ "zh-tw",
+];
+
/**
* Create a stats card text item.
*
- * @param {object} createTextNodeParams Object that contains the createTextNode parameters.
- * @param {string} createTextNodeParams.icon The icon to display.
- * @param {string} createTextNodeParams.label The label to display.
- * @param {number} createTextNodeParams.value The value to display.
- * @param {string} createTextNodeParams.id The id of the stat.
- * @param {string=} createTextNodeParams.unitSymbol The unit symbol of the stat.
- * @param {number} createTextNodeParams.index The index of the stat.
- * @param {boolean} createTextNodeParams.showIcons Whether to show icons.
- * @param {number} createTextNodeParams.shiftValuePos Number of pixels the value has to be shifted to the right.
- * @param {boolean} createTextNodeParams.bold Whether to bold the label.
- * @param {string} createTextNodeParams.number_format The format of numbers on card.
+ * @param {object} params Object that contains the createTextNode parameters.
+ * @param {string} params.icon The icon to display.
+ * @param {string} params.label The label to display.
+ * @param {number} params.value The value to display.
+ * @param {string} params.id The id of the stat.
+ * @param {string=} params.unitSymbol The unit symbol of the stat.
+ * @param {number} params.index The index of the stat.
+ * @param {boolean} params.showIcons Whether to show icons.
+ * @param {number} params.shiftValuePos Number of pixels the value has to be shifted to the right.
+ * @param {boolean} params.bold Whether to bold the label.
+ * @param {string} params.numberFormat The format of numbers on card.
+ * @param {number=} params.numberPrecision The precision of numbers on card.
* @returns {string} The stats card text item SVG object.
*/
const createTextNode = ({
@@ -45,10 +78,17 @@ const createTextNode = ({
showIcons,
shiftValuePos,
bold,
- number_format,
+ numberFormat,
+ numberPrecision,
}) => {
+ const precision =
+ typeof numberPrecision === "number" && !isNaN(numberPrecision)
+ ? clampValue(numberPrecision, 0, 2)
+ : undefined;
const kValue =
- number_format.toLowerCase() === "long" ? value : kFormatter(value);
+ numberFormat.toLowerCase() === "long" || id === "prs_merged_percentage"
+ ? value
+ : kFormatter(value, precision);
const staggerDelay = (index + 3) * 150;
const labelOffset = showIcons ? `x="25"` : "";
@@ -187,6 +227,21 @@ const getStyles = ({
`;
};
+/**
+ * Return the label for commits according to the selected options
+ *
+ * @param {boolean} include_all_commits Option to include all years
+ * @param {number|undefined} commits_year Option to include only selected year
+ * @param {I18n} i18n The I18n instance.
+ * @returns {string} The label corresponding to the options.
+ */
+const getTotalCommitsYearLabel = (include_all_commits, commits_year, i18n) =>
+ include_all_commits
+ ? ""
+ : commits_year
+ ? ` (${commits_year})`
+ : ` (${i18n.t("wakatimecard.lastyear")})`;
+
/**
* @typedef {import('../fetchers/types').StatsData} StatsData
* @typedef {import('./types').StatCardOptions} StatCardOptions
@@ -222,6 +277,7 @@ const renderStatsCard = (stats, options = {}) => {
card_width,
hide_rank = false,
include_all_commits = false,
+ commits_year,
line_height = 25,
title_color,
ring_color,
@@ -234,6 +290,7 @@ const renderStatsCard = (stats, options = {}) => {
border_radius,
border_color,
number_format = "short",
+ number_precision,
locale,
disable_animations = false,
rank_icon = "default",
@@ -254,12 +311,13 @@ const renderStatsCard = (stats, options = {}) => {
theme,
});
- const apostrophe = ["x", "s"].includes(name.slice(-1).toLocaleLowerCase())
- ? ""
- : "s";
+ const apostrophe = /s$/i.test(name.trim()) ? "" : "s";
const i18n = new I18n({
locale,
- translations: statCardLocales({ name, apostrophe }),
+ translations: {
+ ...statCardLocales({ name, apostrophe }),
+ ...wakatimeCardLocales,
+ },
});
// Meta data for creating text nodes with createTextNode function
@@ -273,9 +331,11 @@ const renderStatsCard = (stats, options = {}) => {
};
STATS.commits = {
icon: icons.commits,
- label: `${i18n.t("statcard.commits")}${
- include_all_commits ? "" : ` (${new Date().getFullYear()})`
- }`,
+ label: `${i18n.t("statcard.commits")}${getTotalCommitsYearLabel(
+ include_all_commits,
+ commits_year,
+ i18n,
+ )}`,
value: totalCommits,
id: "commits",
};
@@ -299,7 +359,11 @@ const renderStatsCard = (stats, options = {}) => {
STATS.prs_merged_percentage = {
icon: icons.prs_merged_percentage,
label: i18n.t("statcard.prs-merged-percentage"),
- value: mergedPRsPercentage.toFixed(2),
+ value: mergedPRsPercentage.toFixed(
+ typeof number_precision === "number" && !isNaN(number_precision)
+ ? clampValue(number_precision, 0, 2)
+ : 2,
+ ),
id: "prs_merged_percentage",
unitSymbol: "%",
};
@@ -345,42 +409,31 @@ const renderStatsCard = (stats, options = {}) => {
id: "contribs",
};
- const longLocales = [
- "cn",
- "es",
- "fr",
- "pt-br",
- "ru",
- "uk-ua",
- "id",
- "ml",
- "my",
- "pl",
- "de",
- "nl",
- "zh-tw",
- "uz",
- ];
- const isLongLocale = locale ? longLocales.includes(locale) : false;
+ // @ts-ignore
+ const isLongLocale = locale ? LONG_LOCALES.includes(locale) : false;
// filter out hidden stats defined by user & create the text nodes
const statItems = Object.keys(STATS)
.filter((key) => !hide.includes(key))
- .map((key, index) =>
+ .map((key, index) => {
+ // @ts-ignore
+ const stats = STATS[key];
+
// create the text nodes, and pass index so that we can calculate the line spacing
- createTextNode({
- icon: STATS[key].icon,
- label: STATS[key].label,
- value: STATS[key].value,
- id: STATS[key].id,
- unitSymbol: STATS[key].unitSymbol,
+ return createTextNode({
+ icon: stats.icon,
+ label: stats.label,
+ value: stats.value,
+ id: stats.id,
+ unitSymbol: stats.unitSymbol,
index,
showIcons: show_icons,
shiftValuePos: 79.01 + (isLongLocale ? 50 : 0),
bold: text_bold,
- number_format,
- }),
- );
+ numberFormat: number_format,
+ numberPrecision: number_precision,
+ });
+ });
if (statItems.length === 0 && hide_rank) {
throw new CustomError(
@@ -515,12 +568,16 @@ const renderStatsCard = (stats, options = {}) => {
const labels = Object.keys(STATS)
.filter((key) => !hide.includes(key))
.map((key) => {
+ // @ts-ignore
+ const stats = STATS[key];
if (key === "commits") {
- return `${i18n.t("statcard.commits")} ${
- include_all_commits ? "" : `in ${new Date().getFullYear()}`
- } : ${STATS[key].value}`;
+ return `${i18n.t("statcard.commits")} ${getTotalCommitsYearLabel(
+ include_all_commits,
+ commits_year,
+ i18n,
+ )} : ${stats.value}`;
}
- return `${STATS[key].label}: ${STATS[key].value}`;
+ return `${stats.label}: ${stats.value}`;
})
.join(", ");
diff --git a/src/cards/top-languages-card.js b/src/cards/top-languages.js
similarity index 88%
rename from src/cards/top-languages-card.js
rename to src/cards/top-languages.js
index 9385f4a7ebed3..6a36bfc61ae6a 100644
--- a/src/cards/top-languages-card.js
+++ b/src/cards/top-languages.js
@@ -1,15 +1,15 @@
// @ts-check
+
import { Card } from "../common/Card.js";
-import { createProgressNode } from "../common/createProgressNode.js";
+import { getCardColors } from "../common/color.js";
+import { formatBytes } from "../common/fmt.js";
import { I18n } from "../common/I18n.js";
+import { chunkArray, clampValue, lowercaseTrim } from "../common/ops.js";
import {
- chunkArray,
- clampValue,
+ createProgressNode,
flexLayout,
- getCardColors,
- lowercaseTrim,
measureText,
-} from "../common/utils.js";
+} from "../common/render.js";
import { langCardLocales } from "../translations.js";
const DEFAULT_CARD_WIDTH = 300;
@@ -179,6 +179,7 @@ const trimTopLanguages = (topLangs, langs_count, hide) => {
// while filtering out
if (hide) {
hide.forEach((langName) => {
+ // @ts-ignore
langsToHide[lowercaseTrim(langName)] = true;
});
}
@@ -187,6 +188,7 @@ const trimTopLanguages = (topLangs, langs_count, hide) => {
langs = langs
.sort((a, b) => b.size - a.size)
.filter((lang) => {
+ // @ts-ignore
return !langsToHide[lowercaseTrim(lang.name)];
})
.slice(0, langsCount);
@@ -196,6 +198,18 @@ const trimTopLanguages = (topLangs, langs_count, hide) => {
return { langs, totalLanguageSize };
};
+/**
+ * Get display value corresponding to the format.
+ *
+ * @param {number} size Bytes size.
+ * @param {number} percentages Percentage value.
+ * @param {string} format Format of the stats.
+ * @returns {string} Display value.
+ */
+const getDisplayValue = (size, percentages, format) => {
+ return format === "bytes" ? formatBytes(size) : `${percentages.toFixed(2)}%`;
+};
+
/**
* Create progress bar text item for a programming language.
*
@@ -203,20 +217,33 @@ const trimTopLanguages = (topLangs, langs_count, hide) => {
* @param {number} props.width The card width
* @param {string} props.color Color of the programming language.
* @param {string} props.name Name of the programming language.
- * @param {number} props.progress Usage of the programming language in percentage.
+ * @param {number} props.size Size of the programming language.
+ * @param {number} props.totalSize Total size of all languages.
+ * @param {string} props.statsFormat Stats format.
* @param {number} props.index Index of the programming language.
* @returns {string} Programming language SVG node.
*/
-const createProgressTextNode = ({ width, color, name, progress, index }) => {
+const createProgressTextNode = ({
+ width,
+ color,
+ name,
+ size,
+ totalSize,
+ statsFormat,
+ index,
+}) => {
const staggerDelay = (index + 3) * 150;
const paddingRight = 95;
const progressTextX = width - paddingRight + 10;
const progressWidth = width - paddingRight;
+ const progress = (size / totalSize) * 100;
+ const displayValue = getDisplayValue(size, progress, statsFormat);
+
return `
${name}
- ${progress}%
+ ${displayValue}
${createProgressNode({
x: 0,
y: 25,
@@ -237,11 +264,20 @@ const createProgressTextNode = ({ width, color, name, progress, index }) => {
* @param {Lang} props.lang Programming language object.
* @param {number} props.totalSize Total size of all languages.
* @param {boolean=} props.hideProgress Whether to hide percentage.
+ * @param {string=} props.statsFormat Stats format
* @param {number} props.index Index of the programming language.
* @returns {string} Compact layout programming language SVG node.
*/
-const createCompactLangNode = ({ lang, totalSize, hideProgress, index }) => {
- const percentage = ((lang.size / totalSize) * 100).toFixed(2);
+const createCompactLangNode = ({
+ lang,
+ totalSize,
+ hideProgress,
+ statsFormat = "percentages",
+ index,
+}) => {
+ const percentages = (lang.size / totalSize) * 100;
+ const displayValue = getDisplayValue(lang.size, percentages, statsFormat);
+
const staggerDelay = (index + 3) * 150;
const color = lang.color || "#858585";
@@ -249,7 +285,7 @@ const createCompactLangNode = ({ lang, totalSize, hideProgress, index }) => {
- ${lang.name} ${hideProgress ? "" : percentage + "%"}
+ ${lang.name} ${hideProgress ? "" : displayValue}
`;
@@ -262,9 +298,15 @@ const createCompactLangNode = ({ lang, totalSize, hideProgress, index }) => {
* @param {Lang[]} props.langs Array of programming languages.
* @param {number} props.totalSize Total size of all languages.
* @param {boolean=} props.hideProgress Whether to hide percentage.
+ * @param {string=} props.statsFormat Stats format
* @returns {string} Programming languages SVG node.
*/
-const createLanguageTextNode = ({ langs, totalSize, hideProgress }) => {
+const createLanguageTextNode = ({
+ langs,
+ totalSize,
+ hideProgress,
+ statsFormat,
+}) => {
const longestLang = getLongestLang(langs);
const chunked = chunkArray(langs, langs.length / 2);
const layouts = chunked.map((array) => {
@@ -274,6 +316,7 @@ const createLanguageTextNode = ({ langs, totalSize, hideProgress }) => {
lang,
totalSize,
hideProgress,
+ statsFormat,
index,
}),
);
@@ -299,15 +342,17 @@ const createLanguageTextNode = ({ langs, totalSize, hideProgress }) => {
* @param {object} props Function properties.
* @param {Lang[]} props.langs Array of programming languages.
* @param {number} props.totalSize Total size of all languages.
+ * @param {string} props.statsFormat Stats format
* @returns {string} Donut layout programming language SVG node.
*/
-const createDonutLanguagesNode = ({ langs, totalSize }) => {
+const createDonutLanguagesNode = ({ langs, totalSize, statsFormat }) => {
return flexLayout({
items: langs.map((lang, index) => {
return createCompactLangNode({
lang,
totalSize,
hideProgress: false,
+ statsFormat,
index,
});
}),
@@ -322,18 +367,19 @@ const createDonutLanguagesNode = ({ langs, totalSize }) => {
* @param {Lang[]} langs Array of programming languages.
* @param {number} width Card width.
* @param {number} totalLanguageSize Total size of all languages.
+ * @param {string} statsFormat Stats format.
* @returns {string} Normal layout card SVG object.
*/
-const renderNormalLayout = (langs, width, totalLanguageSize) => {
+const renderNormalLayout = (langs, width, totalLanguageSize, statsFormat) => {
return flexLayout({
items: langs.map((lang, index) => {
return createProgressTextNode({
width,
name: lang.name,
color: lang.color || DEFAULT_LANG_COLOR,
- progress: parseFloat(
- ((lang.size / totalLanguageSize) * 100).toFixed(2),
- ),
+ size: lang.size,
+ totalSize: totalLanguageSize,
+ statsFormat,
index,
});
}),
@@ -349,9 +395,16 @@ const renderNormalLayout = (langs, width, totalLanguageSize) => {
* @param {number} width Card width.
* @param {number} totalLanguageSize Total size of all languages.
* @param {boolean=} hideProgress Whether to hide progress bar.
+ * @param {string} statsFormat Stats format.
* @returns {string} Compact layout card SVG object.
*/
-const renderCompactLayout = (langs, width, totalLanguageSize, hideProgress) => {
+const renderCompactLayout = (
+ langs,
+ width,
+ totalLanguageSize,
+ hideProgress,
+ statsFormat = "percentages",
+) => {
const paddingRight = 50;
const offsetWidth = width - paddingRight;
// progressOffset holds the previous language's width and used to offset the next language
@@ -397,6 +450,7 @@ const renderCompactLayout = (langs, width, totalLanguageSize, hideProgress) => {
langs,
totalSize: totalLanguageSize,
hideProgress,
+ statsFormat,
})}
`;
@@ -407,9 +461,10 @@ const renderCompactLayout = (langs, width, totalLanguageSize, hideProgress) => {
*
* @param {Lang[]} langs Array of programming languages.
* @param {number} totalLanguageSize Total size of all languages.
+ * @param {string} statsFormat Stats format.
* @returns {string} Compact layout card SVG object.
*/
-const renderDonutVerticalLayout = (langs, totalLanguageSize) => {
+const renderDonutVerticalLayout = (langs, totalLanguageSize, statsFormat) => {
// Donut vertical chart radius and total length
const radius = 80;
const totalCircleLength = getCircleLength(radius);
@@ -465,6 +520,7 @@ const renderDonutVerticalLayout = (langs, totalLanguageSize) => {
langs,
totalSize: totalLanguageSize,
hideProgress: false,
+ statsFormat,
})}
@@ -477,9 +533,10 @@ const renderDonutVerticalLayout = (langs, totalLanguageSize) => {
*
* @param {Lang[]} langs Array of programming languages.
* @param {number} totalLanguageSize Total size of all languages.
+ * @param {string} statsFormat Stats format.
* @returns {string} Compact layout card SVG object.
*/
-const renderPieLayout = (langs, totalLanguageSize) => {
+const renderPieLayout = (langs, totalLanguageSize, statsFormat) => {
// Pie chart radius and center coordinates
const radius = 90;
const centerX = 150;
@@ -560,6 +617,7 @@ const renderPieLayout = (langs, totalLanguageSize) => {
langs,
totalSize: totalLanguageSize,
hideProgress: false,
+ statsFormat,
})}
@@ -610,9 +668,10 @@ const createDonutPaths = (cx, cy, radius, percentages) => {
* @param {Lang[]} langs Array of programming languages.
* @param {number} width Card width.
* @param {number} totalLanguageSize Total size of all languages.
+ * @param {string} statsFormat Stats format.
* @returns {string} Donut layout card SVG object.
*/
-const renderDonutLayout = (langs, width, totalLanguageSize) => {
+const renderDonutLayout = (langs, width, totalLanguageSize, statsFormat) => {
const centerX = width / 3;
const centerY = width / 3;
const radius = centerX - 60;
@@ -655,7 +714,7 @@ const renderDonutLayout = (langs, width, totalLanguageSize) => {
return `
- ${createDonutLanguagesNode({ langs, totalSize: totalLanguageSize })}
+ ${createDonutLanguagesNode({ langs, totalSize: totalLanguageSize, statsFormat })}
@@ -738,6 +797,7 @@ const renderTopLanguages = (topLangs, options = {}) => {
border_radius,
border_color,
disable_animations,
+ stats_format = "percentages",
} = options;
const i18n = new I18n({
@@ -779,10 +839,14 @@ const renderTopLanguages = (topLangs, options = {}) => {
});
} else if (layout === "pie") {
height = calculatePieLayoutHeight(langs.length);
- finalLayout = renderPieLayout(langs, totalLanguageSize);
+ finalLayout = renderPieLayout(langs, totalLanguageSize, stats_format);
} else if (layout === "donut-vertical") {
height = calculateDonutVerticalLayoutHeight(langs.length);
- finalLayout = renderDonutVerticalLayout(langs, totalLanguageSize);
+ finalLayout = renderDonutVerticalLayout(
+ langs,
+ totalLanguageSize,
+ stats_format,
+ );
} else if (layout === "compact" || hide_progress == true) {
height =
calculateCompactLayoutHeight(langs.length) + (hide_progress ? -25 : 0);
@@ -792,13 +856,24 @@ const renderTopLanguages = (topLangs, options = {}) => {
width,
totalLanguageSize,
hide_progress,
+ stats_format,
);
} else if (layout === "donut") {
height = calculateDonutLayoutHeight(langs.length);
width = width + 50; // padding
- finalLayout = renderDonutLayout(langs, width, totalLanguageSize);
+ finalLayout = renderDonutLayout(
+ langs,
+ width,
+ totalLanguageSize,
+ stats_format,
+ );
} else {
- finalLayout = renderNormalLayout(langs, width, totalLanguageSize);
+ finalLayout = renderNormalLayout(
+ langs,
+ width,
+ totalLanguageSize,
+ stats_format,
+ );
}
const card = new Card({
diff --git a/src/cards/types.d.ts b/src/cards/types.d.ts
index 9a21be4a0160a..7535df35bbe6f 100644
--- a/src/cards/types.d.ts
+++ b/src/cards/types.d.ts
@@ -20,10 +20,12 @@ export type StatCardOptions = CommonOptions & {
card_width: number;
hide_rank: boolean;
include_all_commits: boolean;
+ commits_year: number;
line_height: number | string;
custom_title: string;
disable_animations: boolean;
number_format: string;
+ number_precision: number;
ring_color: string;
text_bold: boolean;
rank_icon: RankIcon;
@@ -44,11 +46,13 @@ export type TopLangOptions = CommonOptions & {
langs_count: number;
disable_animations: boolean;
hide_progress: boolean;
+ stats_format: "percentages" | "bytes";
};
export type WakaTimeOptions = CommonOptions & {
hide_title: boolean;
hide: string[];
+ card_width: number;
line_height: string;
hide_progress: boolean;
custom_title: string;
diff --git a/src/cards/wakatime-card.js b/src/cards/wakatime.js
similarity index 83%
rename from src/cards/wakatime-card.js
rename to src/cards/wakatime.js
index 65e1d54d779ea..9107e82d51276 100644
--- a/src/cards/wakatime-card.js
+++ b/src/cards/wakatime.js
@@ -1,13 +1,10 @@
// @ts-check
+
import { Card } from "../common/Card.js";
-import { createProgressNode } from "../common/createProgressNode.js";
+import { getCardColors } from "../common/color.js";
import { I18n } from "../common/I18n.js";
-import {
- clampValue,
- flexLayout,
- getCardColors,
- lowercaseTrim,
-} from "../common/utils.js";
+import { clampValue, lowercaseTrim } from "../common/ops.js";
+import { createProgressNode, flexLayout } from "../common/render.js";
import { wakatimeCardLocales } from "../translations.js";
/** Import language colors.
@@ -21,6 +18,15 @@ import { createRequire } from "module";
const require = createRequire(import.meta.url);
const languageColors = require("../common/languageColors.json"); // now works
+const DEFAULT_CARD_WIDTH = 495;
+const MIN_CARD_WIDTH = 250;
+const COMPACT_LAYOUT_MIN_WIDTH = 400;
+const DEFAULT_LINE_HEIGHT = 25;
+const PROGRESSBAR_PADDING = 130;
+const HIDDEN_PROGRESSBAR_PADDING = 170;
+const COMPACT_LAYOUT_PROGRESSBAR_PADDING = 25;
+const TOTAL_TEXT_WIDTH = 275;
+
/**
* Creates the no coding activity SVG node.
*
@@ -64,6 +70,7 @@ const formatLanguageValue = ({ display_format, lang }) => {
* @returns {string} The compact layout language SVG node.
*/
const createCompactLangNode = ({ lang, x, y, display_format }) => {
+ // @ts-ignore
const color = languageColors[lang.name] || "#858585";
const value = formatLanguageValue({ display_format, lang });
@@ -84,22 +91,21 @@ const createCompactLangNode = ({ lang, x, y, display_format }) => {
* @param {WakaTimeLang[]} args.langs The language objects.
* @param {number} args.y The y position of the language node.
* @param {"time" | "percent"} args.display_format The display format of the language node.
+ * @param {number} args.card_width Width in px of the card.
* @returns {string[]} The language text node items.
*/
-const createLanguageTextNode = ({ langs, y, display_format }) => {
+const createLanguageTextNode = ({ langs, y, display_format, card_width }) => {
+ const LEFT_X = 25;
+ const RIGHT_X_BASE = 230;
+ const rightOffset = (card_width - DEFAULT_CARD_WIDTH) / 2;
+ const RIGHT_X = RIGHT_X_BASE + rightOffset;
+
return langs.map((lang, index) => {
- if (index % 2 === 0) {
- return createCompactLangNode({
- lang,
- x: 25,
- y: 12.5 * index + y,
- display_format,
- });
- }
+ const isLeft = index % 2 === 0;
return createCompactLangNode({
lang,
- x: 230,
- y: 12.5 + 12.5 * index,
+ x: isLeft ? LEFT_X : RIGHT_X,
+ y: y + DEFAULT_LINE_HEIGHT * Math.floor(index / 2),
display_format,
});
});
@@ -117,6 +123,7 @@ const createLanguageTextNode = ({ langs, y, display_format }) => {
* @param {boolean=} args.hideProgress Whether to hide the progress bar.
* @param {string} args.progressBarColor The color of the progress bar.
* @param {string} args.progressBarBackgroundColor The color of the progress bar background.
+ * @param {number} args.progressBarWidth The width of the progress bar.
* @returns {string} The text SVG node.
*/
const createTextNode = ({
@@ -128,9 +135,9 @@ const createTextNode = ({
hideProgress,
progressBarColor,
progressBarBackgroundColor,
+ progressBarWidth,
}) => {
const staggerDelay = (index + 3) * 150;
-
const cardProgress = hideProgress
? null
: createProgressNode({
@@ -138,7 +145,7 @@ const createTextNode = ({
y: 4,
progress: percent,
color: progressBarColor,
- width: 220,
+ width: progressBarWidth,
// @ts-ignore
name: label,
progressBarBackgroundColor,
@@ -150,7 +157,7 @@ const createTextNode = ({
${label}:${value}
${cardProgress}
@@ -206,6 +213,24 @@ const getStyles = ({
`;
};
+/**
+ * Normalize incoming width (string or number) and clamp to minimum.
+ *
+ * @param {Object} args The function arguments.
+ * @param {WakaTimeOptions["layout"] | undefined} args.layout The incoming layout value.
+ * @param {number|undefined} args.value The incoming width value.
+ * @returns {number} The normalized width value.
+ */
+const normalizeCardWidth = ({ value, layout }) => {
+ if (value === undefined || value === null || isNaN(value)) {
+ return DEFAULT_CARD_WIDTH;
+ }
+ return Math.max(
+ layout === "compact" ? COMPACT_LAYOUT_MIN_WIDTH : MIN_CARD_WIDTH,
+ value,
+ );
+};
+
/**
* @typedef {import('../fetchers/types').WakaTimeData} WakaTimeData
* @typedef {import('./types').WakaTimeOptions} WakaTimeOptions
@@ -223,8 +248,9 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
const {
hide_title = false,
hide_border = false,
+ card_width,
hide,
- line_height = 25,
+ line_height = DEFAULT_LINE_HEIGHT,
title_color,
icon_color,
text_color,
@@ -241,6 +267,8 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
disable_animations,
} = options;
+ const normalizedWidth = normalizeCardWidth({ value: card_width, layout });
+
const shouldHideLangs = Array.isArray(hide) && hide.length > 0;
if (shouldHideLangs) {
const languagesToHide = new Set(hide.map((lang) => lowercaseTrim(lang)));
@@ -289,21 +317,22 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
let finalLayout = "";
- let width = 440;
-
// RENDER COMPACT LAYOUT
if (layout === "compact") {
- width = width + 50;
- height = 90 + Math.round(filteredLanguages.length / 2) * 25;
+ const width = normalizedWidth - 5;
+ height =
+ 90 + Math.round(filteredLanguages.length / 2) * DEFAULT_LINE_HEIGHT;
// progressOffset holds the previous language's width and used to offset the next language
// so that we can stack them one after another, like this: [--][----][---]
let progressOffset = 0;
const compactProgressBar = filteredLanguages
.map((language) => {
- // const progress = (width * lang.percent) / 100;
- const progress = ((width - 25) * language.percent) / 100;
+ const progress =
+ ((width - COMPACT_LAYOUT_PROGRESSBAR_PADDING) * language.percent) /
+ 100;
+ // @ts-ignore
const languageColor = languageColors[language.name] || "#858585";
const output = `
@@ -324,7 +353,7 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
finalLayout = `
-
+
${compactProgressBar}
${
@@ -333,6 +362,7 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
y: 25,
langs: filteredLanguages,
display_format,
+ card_width: normalizedWidth,
}).join("")
: noCodingActivityNode({
// @ts-ignore
@@ -360,6 +390,7 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
// @ts-ignore
progressBarBackgroundColor: textColor,
hideProgress: hide_progress,
+ progressBarWidth: normalizedWidth - TOTAL_TEXT_WIDTH,
});
})
: [
@@ -392,7 +423,7 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
const card = new Card({
customTitle: custom_title,
defaultTitle: titleText,
- width: 495,
+ width: normalizedWidth,
height,
border_radius,
colors: {
diff --git a/src/common/Card.js b/src/common/Card.js
index d32da56255f89..45bc81fe11460 100644
--- a/src/common/Card.js
+++ b/src/common/Card.js
@@ -1,23 +1,25 @@
-import { encodeHTML, flexLayout } from "./utils.js";
+// @ts-check
+
+import { encodeHTML } from "./html.js";
+import { flexLayout } from "./render.js";
class Card {
/**
* Creates a new card instance.
*
* @param {object} args Card arguments.
- * @param {number?=} args.width Card width.
- * @param {number?=} args.height Card height.
- * @param {number?=} args.border_radius Card border radius.
- * @param {string?=} args.customTitle Card custom title.
- * @param {string?=} args.defaultTitle Card default title.
- * @param {string?=} args.titlePrefixIcon Card title prefix icon.
- * @param {object?=} args.colors Card colors arguments.
- * @param {string} args.colors.titleColor Card title color.
- * @param {string} args.colors.textColor Card text color.
- * @param {string} args.colors.iconColor Card icon color.
- * @param {string|Array} args.colors.bgColor Card background color.
- * @param {string} args.colors.borderColor Card border color.
- * @returns {Card} Card instance.
+ * @param {number=} args.width Card width.
+ * @param {number=} args.height Card height.
+ * @param {number=} args.border_radius Card border radius.
+ * @param {string=} args.customTitle Card custom title.
+ * @param {string=} args.defaultTitle Card default title.
+ * @param {string=} args.titlePrefixIcon Card title prefix icon.
+ * @param {object} [args.colors={}] Card colors arguments.
+ * @param {string=} args.colors.titleColor Card title color.
+ * @param {string=} args.colors.textColor Card text color.
+ * @param {string=} args.colors.iconColor Card icon color.
+ * @param {string|string[]=} args.colors.bgColor Card background color.
+ * @param {string=} args.colors.borderColor Card border color.
*/
constructor({
width = 100,
@@ -138,7 +140,7 @@ class Card {
transform="translate(${this.paddingX}, ${this.paddingY})"
>
${flexLayout({
- items: [this.titlePrefixIcon && prefixIcon, titleText],
+ items: [this.titlePrefixIcon ? prefixIcon : "", titleText],
gap: 25,
}).join("")}
diff --git a/src/common/I18n.js b/src/common/I18n.js
index bd5f29fcb6a84..75b9c91aa2766 100644
--- a/src/common/I18n.js
+++ b/src/common/I18n.js
@@ -1,3 +1,5 @@
+// @ts-check
+
const FALLBACK_LOCALE = "en";
/**
@@ -9,7 +11,7 @@ class I18n {
*
* @param {Object} options Options.
* @param {string=} options.locale Locale.
- * @param {Object} options.translations Translations.
+ * @param {any} options.translations Translations.
*/
constructor({ locale, translations }) {
this.locale = locale || FALLBACK_LOCALE;
diff --git a/src/common/access.js b/src/common/access.js
new file mode 100644
index 0000000000000..25777356b55c5
--- /dev/null
+++ b/src/common/access.js
@@ -0,0 +1,69 @@
+// @ts-check
+
+import { renderError } from "./render.js";
+import { blacklist } from "./blacklist.js";
+import { whitelist, gistWhitelist } from "./envs.js";
+
+const NOT_WHITELISTED_USERNAME_MESSAGE = "This username is not whitelisted";
+const NOT_WHITELISTED_GIST_MESSAGE = "This gist ID is not whitelisted";
+const BLACKLISTED_MESSAGE = "This username is blacklisted";
+
+/**
+ * Guards access using whitelist/blacklist.
+ *
+ * @param {Object} args The parameters object.
+ * @param {any} args.res The response object.
+ * @param {string} args.id Resource identifier (username or gist id).
+ * @param {"username"|"gist"|"wakatime"} args.type The type of identifier.
+ * @param {{ title_color?: string, text_color?: string, bg_color?: string, border_color?: string, theme?: string }} args.colors Color options for the error card.
+ * @returns {{ isPassed: boolean, result?: any }} The result object indicating success or failure.
+ */
+const guardAccess = ({ res, id, type, colors }) => {
+ if (!["username", "gist", "wakatime"].includes(type)) {
+ throw new Error(
+ 'Invalid type. Expected "username", "gist", or "wakatime".',
+ );
+ }
+
+ const currentWhitelist = type === "gist" ? gistWhitelist : whitelist;
+ const notWhitelistedMsg =
+ type === "gist"
+ ? NOT_WHITELISTED_GIST_MESSAGE
+ : NOT_WHITELISTED_USERNAME_MESSAGE;
+
+ if (Array.isArray(currentWhitelist) && !currentWhitelist.includes(id)) {
+ const result = res.send(
+ renderError({
+ message: notWhitelistedMsg,
+ secondaryMessage: "Please deploy your own instance",
+ renderOptions: {
+ ...colors,
+ show_repo_link: false,
+ },
+ }),
+ );
+ return { isPassed: false, result };
+ }
+
+ if (
+ type === "username" &&
+ currentWhitelist === undefined &&
+ blacklist.includes(id)
+ ) {
+ const result = res.send(
+ renderError({
+ message: BLACKLISTED_MESSAGE,
+ secondaryMessage: "Please deploy your own instance",
+ renderOptions: {
+ ...colors,
+ show_repo_link: false,
+ },
+ }),
+ );
+ return { isPassed: false, result };
+ }
+
+ return { isPassed: true };
+};
+
+export { guardAccess };
diff --git a/src/common/cache.js b/src/common/cache.js
new file mode 100644
index 0000000000000..dc6217e28fd2a
--- /dev/null
+++ b/src/common/cache.js
@@ -0,0 +1,153 @@
+// @ts-check
+
+import { clampValue } from "./ops.js";
+
+const MIN = 60;
+const HOUR = 60 * MIN;
+const DAY = 24 * HOUR;
+
+/**
+ * Common durations in seconds.
+ */
+const DURATIONS = {
+ 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,
+ TWELVE_HOURS: 12 * HOUR,
+
+ ONE_DAY: DAY,
+ TWO_DAY: 2 * DAY,
+ SIX_DAY: 6 * DAY,
+ TEN_DAY: 10 * DAY,
+};
+
+/**
+ * Common cache TTL values in seconds.
+ */
+const CACHE_TTL = {
+ STATS_CARD: {
+ DEFAULT: DURATIONS.ONE_DAY,
+ MIN: DURATIONS.TWELVE_HOURS,
+ MAX: DURATIONS.TWO_DAY,
+ },
+ TOP_LANGS_CARD: {
+ DEFAULT: DURATIONS.SIX_DAY,
+ MIN: DURATIONS.TWO_DAY,
+ MAX: DURATIONS.TEN_DAY,
+ },
+ PIN_CARD: {
+ DEFAULT: DURATIONS.TEN_DAY,
+ MIN: DURATIONS.ONE_DAY,
+ MAX: DURATIONS.TEN_DAY,
+ },
+ GIST_CARD: {
+ DEFAULT: DURATIONS.TWO_DAY,
+ MIN: DURATIONS.ONE_DAY,
+ MAX: DURATIONS.TEN_DAY,
+ },
+ WAKATIME_CARD: {
+ DEFAULT: DURATIONS.ONE_DAY,
+ MIN: DURATIONS.TWELVE_HOURS,
+ MAX: DURATIONS.TWO_DAY,
+ },
+ ERROR: DURATIONS.TEN_MINUTES,
+};
+
+/**
+ * Resolves the cache seconds based on the requested, default, min, and max values.
+ *
+ * @param {Object} args The parameters object.
+ * @param {number} args.requested The requested cache seconds.
+ * @param {number} args.def The default cache seconds.
+ * @param {number} args.min The minimum cache seconds.
+ * @param {number} args.max The maximum cache seconds.
+ * @returns {number} The resolved cache seconds.
+ */
+const resolveCacheSeconds = ({ requested, def, min, max }) => {
+ let cacheSeconds = clampValue(isNaN(requested) ? def : requested, min, max);
+
+ if (process.env.CACHE_SECONDS) {
+ const envCacheSeconds = parseInt(process.env.CACHE_SECONDS, 10);
+ if (!isNaN(envCacheSeconds)) {
+ cacheSeconds = envCacheSeconds;
+ }
+ }
+
+ return cacheSeconds;
+};
+
+/**
+ * Disables caching by setting appropriate headers on the response object.
+ *
+ * @param {any} res The response object.
+ */
+const disableCaching = (res) => {
+ // Disable caching for browsers, shared caches/CDNs, and GitHub Camo.
+ res.setHeader(
+ "Cache-Control",
+ "no-cache, no-store, must-revalidate, max-age=0, s-maxage=0",
+ );
+ res.setHeader("Pragma", "no-cache");
+ res.setHeader("Expires", "0");
+};
+
+/**
+ * Sets the Cache-Control headers on the response object.
+ *
+ * @param {any} res The response object.
+ * @param {number} cacheSeconds The cache seconds to set in the headers.
+ */
+const setCacheHeaders = (res, cacheSeconds) => {
+ if (cacheSeconds < 1 || process.env.NODE_ENV === "development") {
+ disableCaching(res);
+ return;
+ }
+
+ res.setHeader(
+ "Cache-Control",
+ `max-age=${cacheSeconds}, ` +
+ `s-maxage=${cacheSeconds}, ` +
+ `stale-while-revalidate=${DURATIONS.ONE_DAY}`,
+ );
+};
+
+/**
+ * Sets the Cache-Control headers for error responses on the response object.
+ *
+ * @param {any} res The response object.
+ */
+const setErrorCacheHeaders = (res) => {
+ const envCacheSeconds = process.env.CACHE_SECONDS
+ ? parseInt(process.env.CACHE_SECONDS, 10)
+ : NaN;
+ if (
+ (!isNaN(envCacheSeconds) && envCacheSeconds < 1) ||
+ process.env.NODE_ENV === "development"
+ ) {
+ disableCaching(res);
+ return;
+ }
+
+ // Use lower cache period for errors.
+ res.setHeader(
+ "Cache-Control",
+ `max-age=${CACHE_TTL.ERROR}, ` +
+ `s-maxage=${CACHE_TTL.ERROR}, ` +
+ `stale-while-revalidate=${DURATIONS.ONE_DAY}`,
+ );
+};
+
+export {
+ resolveCacheSeconds,
+ setCacheHeaders,
+ setErrorCacheHeaders,
+ DURATIONS,
+ CACHE_TTL,
+};
diff --git a/src/common/color.js b/src/common/color.js
new file mode 100644
index 0000000000000..a372f24401a9a
--- /dev/null
+++ b/src/common/color.js
@@ -0,0 +1,144 @@
+// @ts-check
+
+import { themes } from "../../themes/index.js";
+
+/**
+ * Checks if a string is a valid hex color.
+ *
+ * @param {string} hexColor String to check.
+ * @returns {boolean} True if the given string is a valid hex color.
+ */
+const isValidHexColor = (hexColor) => {
+ return new RegExp(
+ /^([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{4})$/,
+ ).test(hexColor);
+};
+
+/**
+ * Check if the given string is a valid gradient.
+ *
+ * @param {string[]} colors Array of colors.
+ * @returns {boolean} True if the given string is a valid gradient.
+ */
+const isValidGradient = (colors) => {
+ return (
+ colors.length > 2 &&
+ colors.slice(1).every((color) => isValidHexColor(color))
+ );
+};
+
+/**
+ * Retrieves a gradient if color has more than one valid hex codes else a single color.
+ *
+ * @param {string} color The color to parse.
+ * @param {string | string[]} fallbackColor The fallback color.
+ * @returns {string | string[]} The gradient or color.
+ */
+const fallbackColor = (color, fallbackColor) => {
+ let gradient = null;
+
+ let colors = color ? color.split(",") : [];
+ if (colors.length > 1 && isValidGradient(colors)) {
+ gradient = colors;
+ }
+
+ return (
+ (gradient ? gradient : isValidHexColor(color) && `#${color}`) ||
+ fallbackColor
+ );
+};
+
+/**
+ * Object containing card colors.
+ * @typedef {{
+ * titleColor: string;
+ * iconColor: string;
+ * textColor: string;
+ * bgColor: string | string[];
+ * borderColor: string;
+ * ringColor: string;
+ * }} CardColors
+ */
+
+/**
+ * Returns theme based colors with proper overrides and defaults.
+ *
+ * @param {Object} args Function arguments.
+ * @param {string=} args.title_color Card title color.
+ * @param {string=} args.text_color Card text color.
+ * @param {string=} args.icon_color Card icon color.
+ * @param {string=} args.bg_color Card background color.
+ * @param {string=} args.border_color Card border color.
+ * @param {string=} args.ring_color Card ring color.
+ * @param {string=} args.theme Card theme.
+ * @returns {CardColors} Card colors.
+ */
+const getCardColors = ({
+ title_color,
+ text_color,
+ icon_color,
+ bg_color,
+ border_color,
+ ring_color,
+ theme,
+}) => {
+ const defaultTheme = themes["default"];
+ const isThemeProvided = theme !== null && theme !== undefined;
+
+ // @ts-ignore
+ const selectedTheme = isThemeProvided ? themes[theme] : defaultTheme;
+
+ const defaultBorderColor =
+ "border_color" in selectedTheme
+ ? selectedTheme.border_color
+ : // @ts-ignore
+ defaultTheme.border_color;
+
+ // get the color provided by the user else the theme color
+ // finally if both colors are invalid fallback to default theme
+ const titleColor = fallbackColor(
+ title_color || selectedTheme.title_color,
+ "#" + defaultTheme.title_color,
+ );
+
+ // get the color provided by the user else the theme color
+ // finally if both colors are invalid we use the titleColor
+ const ringColor = fallbackColor(
+ // @ts-ignore
+ ring_color || selectedTheme.ring_color,
+ titleColor,
+ );
+ const iconColor = fallbackColor(
+ icon_color || selectedTheme.icon_color,
+ "#" + defaultTheme.icon_color,
+ );
+ const textColor = fallbackColor(
+ text_color || selectedTheme.text_color,
+ "#" + defaultTheme.text_color,
+ );
+ const bgColor = fallbackColor(
+ bg_color || selectedTheme.bg_color,
+ "#" + defaultTheme.bg_color,
+ );
+
+ const borderColor = fallbackColor(
+ border_color || defaultBorderColor,
+ "#" + defaultBorderColor,
+ );
+
+ if (
+ typeof titleColor !== "string" ||
+ typeof textColor !== "string" ||
+ typeof ringColor !== "string" ||
+ typeof iconColor !== "string" ||
+ typeof borderColor !== "string"
+ ) {
+ throw new Error(
+ "Unexpected behavior, all colors except background should be string.",
+ );
+ }
+
+ return { titleColor, iconColor, textColor, bgColor, borderColor, ringColor };
+};
+
+export { isValidHexColor, isValidGradient, getCardColors };
diff --git a/src/common/createProgressNode.js b/src/common/createProgressNode.js
deleted file mode 100644
index 2d7303a5a78ef..0000000000000
--- a/src/common/createProgressNode.js
+++ /dev/null
@@ -1,46 +0,0 @@
-// @ts-check
-
-import { clampValue } from "./utils.js";
-
-/**
- * Create a node to indicate progress in percentage along a horizontal line.
- *
- * @param {Object} createProgressNodeParams Object that contains the createProgressNode parameters.
- * @param {number} createProgressNodeParams.x X-axis position.
- * @param {number} createProgressNodeParams.y Y-axis position.
- * @param {number} createProgressNodeParams.width Width of progress bar.
- * @param {string} createProgressNodeParams.color Progress color.
- * @param {number} createProgressNodeParams.progress Progress value.
- * @param {string} createProgressNodeParams.progressBarBackgroundColor Progress bar bg color.
- * @param {number} createProgressNodeParams.delay Delay before animation starts.
- * @returns {string} Progress node.
- */
-const createProgressNode = ({
- x,
- y,
- width,
- color,
- progress,
- progressBarBackgroundColor,
- delay,
-}) => {
- const progressPercentage = clampValue(progress, 2, 100);
-
- return `
-
- `;
-};
-
-export { createProgressNode };
-export default createProgressNode;
diff --git a/src/common/envs.js b/src/common/envs.js
new file mode 100644
index 0000000000000..5f1319662b94d
--- /dev/null
+++ b/src/common/envs.js
@@ -0,0 +1,15 @@
+// @ts-check
+
+const whitelist = process.env.WHITELIST
+ ? process.env.WHITELIST.split(",")
+ : undefined;
+
+const gistWhitelist = process.env.GIST_WHITELIST
+ ? process.env.GIST_WHITELIST.split(",")
+ : undefined;
+
+const excludeRepositories = process.env.EXCLUDE_REPO
+ ? process.env.EXCLUDE_REPO.split(",")
+ : [];
+
+export { whitelist, gistWhitelist, excludeRepositories };
diff --git a/src/common/error.js b/src/common/error.js
new file mode 100644
index 0000000000000..d3547bab4df45
--- /dev/null
+++ b/src/common/error.js
@@ -0,0 +1,84 @@
+// @ts-check
+
+/**
+ * @type {string} A general message to ask user to try again later.
+ */
+const TRY_AGAIN_LATER = "Please try again later";
+
+/**
+ * @type {Object} A map of error types to secondary error messages.
+ */
+const SECONDARY_ERROR_MESSAGES = {
+ MAX_RETRY:
+ "You can deploy own instance or wait until public will be no longer limited",
+ NO_TOKENS:
+ "Please add an env variable called PAT_1 with your GitHub API token in vercel",
+ USER_NOT_FOUND: "Make sure the provided username is not an organization",
+ GRAPHQL_ERROR: TRY_AGAIN_LATER,
+ GITHUB_REST_API_ERROR: TRY_AGAIN_LATER,
+ WAKATIME_USER_NOT_FOUND: "Make sure you have a public WakaTime profile",
+};
+
+/**
+ * Custom error class to handle custom GRS errors.
+ */
+class CustomError extends Error {
+ /**
+ * Custom error constructor.
+ *
+ * @param {string} message Error message.
+ * @param {string} type Error type.
+ */
+ constructor(message, type) {
+ super(message);
+ this.type = type;
+ this.secondaryMessage = SECONDARY_ERROR_MESSAGES[type] || type;
+ }
+
+ static MAX_RETRY = "MAX_RETRY";
+ static NO_TOKENS = "NO_TOKENS";
+ static USER_NOT_FOUND = "USER_NOT_FOUND";
+ static GRAPHQL_ERROR = "GRAPHQL_ERROR";
+ static GITHUB_REST_API_ERROR = "GITHUB_REST_API_ERROR";
+ static WAKATIME_ERROR = "WAKATIME_ERROR";
+}
+
+/**
+ * Missing query parameter class.
+ */
+class MissingParamError extends Error {
+ /**
+ * Missing query parameter error constructor.
+ *
+ * @param {string[]} missedParams An array of missing parameters names.
+ * @param {string=} secondaryMessage Optional secondary message to display.
+ */
+ constructor(missedParams, secondaryMessage) {
+ const msg = `Missing params ${missedParams
+ .map((p) => `"${p}"`)
+ .join(", ")} make sure you pass the parameters in URL`;
+ super(msg);
+ this.missedParams = missedParams;
+ this.secondaryMessage = secondaryMessage;
+ }
+}
+
+/**
+ * Retrieve secondary message from an error object.
+ *
+ * @param {Error} err The error object.
+ * @returns {string|undefined} The secondary message if available, otherwise undefined.
+ */
+const retrieveSecondaryMessage = (err) => {
+ return "secondaryMessage" in err && typeof err.secondaryMessage === "string"
+ ? err.secondaryMessage
+ : undefined;
+};
+
+export {
+ CustomError,
+ MissingParamError,
+ SECONDARY_ERROR_MESSAGES,
+ TRY_AGAIN_LATER,
+ retrieveSecondaryMessage,
+};
diff --git a/src/common/fmt.js b/src/common/fmt.js
new file mode 100644
index 0000000000000..5820b53e3f078
--- /dev/null
+++ b/src/common/fmt.js
@@ -0,0 +1,90 @@
+// @ts-check
+
+import wrap from "word-wrap";
+import { encodeHTML } from "./html.js";
+
+/**
+ * Retrieves num with suffix k(thousands) precise to given decimal places.
+ *
+ * @param {number} num The number to format.
+ * @param {number=} precision The number of decimal places to include.
+ * @returns {string|number} The formatted number.
+ */
+const kFormatter = (num, precision) => {
+ const abs = Math.abs(num);
+ const sign = Math.sign(num);
+
+ if (typeof precision === "number" && !isNaN(precision)) {
+ return (sign * (abs / 1000)).toFixed(precision) + "k";
+ }
+
+ if (abs < 1000) {
+ return sign * abs;
+ }
+
+ return sign * parseFloat((abs / 1000).toFixed(1)) + "k";
+};
+
+/**
+ * Convert bytes to a human-readable string representation.
+ *
+ * @param {number} bytes The number of bytes to convert.
+ * @returns {string} The human-readable representation of bytes.
+ * @throws {Error} If bytes is negative or too large.
+ */
+const formatBytes = (bytes) => {
+ if (bytes < 0) {
+ throw new Error("Bytes must be a non-negative number");
+ }
+
+ if (bytes === 0) {
+ return "0 B";
+ }
+
+ const sizes = ["B", "KB", "MB", "GB", "TB", "PB", "EB"];
+ const base = 1024;
+ const i = Math.floor(Math.log(bytes) / Math.log(base));
+
+ if (i >= sizes.length) {
+ throw new Error("Bytes is too large to convert to a human-readable string");
+ }
+
+ return `${(bytes / Math.pow(base, i)).toFixed(1)} ${sizes[i]}`;
+};
+
+/**
+ * Split text over multiple lines based on the card width.
+ *
+ * @param {string} text Text to split.
+ * @param {number} width Line width in number of characters.
+ * @param {number} maxLines Maximum number of lines.
+ * @returns {string[]} Array of lines.
+ */
+const wrapTextMultiline = (text, width = 59, maxLines = 3) => {
+ const fullWidthComma = ",";
+ const encoded = encodeHTML(text);
+ const isChinese = encoded.includes(fullWidthComma);
+
+ let wrapped = [];
+
+ if (isChinese) {
+ wrapped = encoded.split(fullWidthComma); // Chinese full punctuation
+ } else {
+ wrapped = wrap(encoded, {
+ width,
+ }).split("\n"); // Split wrapped lines to get an array of lines
+ }
+
+ const lines = wrapped.map((line) => line.trim()).slice(0, maxLines); // Only consider maxLines lines
+
+ // Add "..." to the last line if the text exceeds maxLines
+ if (wrapped.length > maxLines) {
+ lines[maxLines - 1] += "...";
+ }
+
+ // Remove empty lines if text fits in less than maxLines lines
+ const multiLineText = lines.filter(Boolean);
+ return multiLineText;
+};
+
+export { kFormatter, formatBytes, wrapTextMultiline };
diff --git a/src/common/html.js b/src/common/html.js
new file mode 100644
index 0000000000000..2b1db470f5373
--- /dev/null
+++ b/src/common/html.js
@@ -0,0 +1,19 @@
+// @ts-check
+
+/**
+ * Encode string as HTML.
+ *
+ * @see https://stackoverflow.com/a/48073476/10629172
+ *
+ * @param {string} str String to encode.
+ * @returns {string} Encoded string.
+ */
+const encodeHTML = (str) => {
+ return str
+ .replace(/[\u00A0-\u9999<>&](?!#)/gim, (i) => {
+ return "" + i.charCodeAt(0) + ";";
+ })
+ .replace(/\u0008/gim, "");
+};
+
+export { encodeHTML };
diff --git a/src/common/http.js b/src/common/http.js
new file mode 100644
index 0000000000000..ef6258b0b85eb
--- /dev/null
+++ b/src/common/http.js
@@ -0,0 +1,21 @@
+// @ts-check
+
+import axios from "axios";
+
+/**
+ * Send GraphQL request to GitHub API.
+ *
+ * @param {import('axios').AxiosRequestConfig['data']} data Request data.
+ * @param {import('axios').AxiosRequestConfig['headers']} headers Request headers.
+ * @returns {Promise} Request response.
+ */
+const request = (data, headers) => {
+ return axios({
+ url: "https://api.github.com/graphql",
+ method: "post",
+ headers,
+ data,
+ });
+};
+
+export { request };
diff --git a/src/common/icons.js b/src/common/icons.js
index 771704a335d12..98023b675e292 100644
--- a/src/common/icons.js
+++ b/src/common/icons.js
@@ -1,3 +1,5 @@
+// @ts-check
+
const icons = {
star: ``,
commits: ``,
diff --git a/src/common/index.js b/src/common/index.js
index 2e7e9cb20fe0b..db914b86b1ebe 100644
--- a/src/common/index.js
+++ b/src/common/index.js
@@ -1,30 +1,13 @@
+// @ts-check
+
export { blacklist } from "./blacklist.js";
export { Card } from "./Card.js";
-export { createProgressNode } from "./createProgressNode.js";
export { I18n } from "./I18n.js";
export { icons } from "./icons.js";
export { retryer } from "./retryer.js";
export {
ERROR_CARD_LENGTH,
renderError,
- encodeHTML,
- kFormatter,
- isValidHexColor,
- parseBoolean,
- parseArray,
- clampValue,
- isValidGradient,
- fallbackColor,
- request,
flexLayout,
- getCardColors,
- wrapTextMultiline,
- logger,
- CONSTANTS,
- CustomError,
- MissingParamError,
measureText,
- lowercaseTrim,
- chunkArray,
- parseEmojis,
-} from "./utils.js";
+} from "./render.js";
diff --git a/src/common/languageColors.json b/src/common/languageColors.json
index 6c23a4bb20b24..9d6b0fa287671 100644
--- a/src/common/languageColors.json
+++ b/src/common/languageColors.json
@@ -31,6 +31,7 @@
"Apollo Guidance Computer": "#0B3D91",
"AppleScript": "#101F1F",
"Arc": "#aa2afe",
+ "ArkTS": "#0080ff",
"AsciiDoc": "#73a0c5",
"AspectJ": "#a957b0",
"Assembly": "#6E4C13",
@@ -64,10 +65,12 @@
"BrighterScript": "#66AABB",
"Brightscript": "#662D91",
"Browserslist": "#ffd539",
+ "Bru": "#F4AA41",
"BuildStream": "#006bff",
"C": "#555555",
"C#": "#178600",
"C++": "#f34b7d",
+ "C3": "#2563eb",
"CAP CDS": "#0092d1",
"CLIPS": "#00A300",
"CMake": "#DA3434",
@@ -83,6 +86,7 @@
"Cairo": "#ff4a48",
"Cairo Zero": "#ff4a48",
"CameLIGO": "#3be133",
+ "Cangjie": "#00868B",
"Cap'n Proto": "#c42727",
"Carbon": "#222222",
"Ceylon": "#dfa535",
@@ -106,6 +110,7 @@
"Common Lisp": "#3fb68b",
"Common Workflow Language": "#B5314C",
"Component Pascal": "#B0CE4E",
+ "Cooklang": "#E15A29",
"Crystal": "#000100",
"Csound": "#1a1a1a",
"Csound Document": "#1a1a1a",
@@ -164,6 +169,7 @@
"Faust": "#c37240",
"Fennel": "#fff3d7",
"Filebench WML": "#F6B900",
+ "Flix": "#d44a45",
"Fluent": "#ffcc33",
"Forth": "#341708",
"Fortran": "#4d41b1",
@@ -194,6 +200,7 @@
"Gerber Image": "#d20b00",
"Gherkin": "#5B2063",
"Git Attributes": "#F44D27",
+ "Git Commit": "#F44D27",
"Git Config": "#F44D27",
"Git Revision List": "#F44D27",
"Gleam": "#ffaff3",
@@ -239,6 +246,7 @@
"HiveQL": "#dce200",
"HolyC": "#ffefaf",
"Hosts File": "#308888",
+ "Hurl": "#FF0288",
"Hy": "#7790B2",
"IDL": "#a3522f",
"IGOR Pro": "#0000cc",
@@ -290,6 +298,7 @@
"KiCad Layout": "#2f4aab",
"KiCad Legacy Layout": "#2f4aab",
"KiCad Schematic": "#2f4aab",
+ "KoLmafia ASH": "#B9D9B9",
"Koka": "#215166",
"Kotlin": "#A97BFF",
"LFE": "#4C3023",
@@ -329,7 +338,6 @@
"Markdown": "#083fa1",
"Marko": "#42bff2",
"Mask": "#f97732",
- "Mathematica": "#dd1100",
"Max": "#c4a79c",
"Mercury": "#ff2b2b",
"Mermaid": "#ff3670",
@@ -445,6 +453,7 @@
"QML": "#44a51c",
"Qt Script": "#00b841",
"Quake": "#882233",
+ "QuakeC": "#975777",
"QuickBASIC": "#008080",
"R": "#198CE7",
"RAML": "#77d9fb",
@@ -453,6 +462,7 @@
"REXX": "#d90e09",
"RMarkdown": "#198ce7",
"RON": "#a62c00",
+ "ROS Interface": "#22314e",
"RPGLE": "#2BDE21",
"RUNOFF": "#665a4e",
"Racket": "#3c5caa",
@@ -543,6 +553,7 @@
"Talon": "#333333",
"Tcl": "#e4cc98",
"TeX": "#3D6117",
+ "Teal": "#00B1BC",
"Terra": "#00004c",
"Terraform Template": "#7b42bb",
"TextGrid": "#c8506d",
@@ -590,6 +601,7 @@
"Wikitext": "#fc5757",
"Windows Registry Entries": "#52d5ff",
"Witcher Script": "#ff0000",
+ "Wolfram Language": "#dd1100",
"Wollok": "#a23738",
"World of Warcraft Addon Data": "#f7e43f",
"Wren": "#383838",
diff --git a/src/common/log.js b/src/common/log.js
new file mode 100644
index 0000000000000..8a0e58b6bc566
--- /dev/null
+++ b/src/common/log.js
@@ -0,0 +1,14 @@
+// @ts-check
+
+const noop = () => {};
+
+/**
+ * Return console instance based on the environment.
+ *
+ * @type {Console | {log: () => void, error: () => void}}
+ */
+const logger =
+ process.env.NODE_ENV === "test" ? { log: noop, error: noop } : console;
+
+export { logger };
+export default logger;
diff --git a/src/common/ops.js b/src/common/ops.js
new file mode 100644
index 0000000000000..b4db6e60c8a92
--- /dev/null
+++ b/src/common/ops.js
@@ -0,0 +1,124 @@
+// @ts-check
+
+import toEmoji from "emoji-name-map";
+
+/**
+ * Returns boolean if value is either "true" or "false" else the value as it is.
+ *
+ * @param {string | boolean} value The value to parse.
+ * @returns {boolean | undefined } The parsed value.
+ */
+const parseBoolean = (value) => {
+ if (typeof value === "boolean") {
+ return value;
+ }
+
+ if (typeof value === "string") {
+ if (value.toLowerCase() === "true") {
+ return true;
+ } else if (value.toLowerCase() === "false") {
+ return false;
+ }
+ }
+ return undefined;
+};
+
+/**
+ * Parse string to array of strings.
+ *
+ * @param {string} str The string to parse.
+ * @returns {string[]} The array of strings.
+ */
+const parseArray = (str) => {
+ if (!str) {
+ return [];
+ }
+ return str.split(",");
+};
+
+/**
+ * Clamp the given number between the given range.
+ *
+ * @param {number} number The number to clamp.
+ * @param {number} min The minimum value.
+ * @param {number} max The maximum value.
+ * @returns {number} The clamped number.
+ */
+const clampValue = (number, min, max) => {
+ // @ts-ignore
+ if (Number.isNaN(parseInt(number, 10))) {
+ return min;
+ }
+ return Math.max(min, Math.min(number, max));
+};
+
+/**
+ * Lowercase and trim string.
+ *
+ * @param {string} name String to lowercase and trim.
+ * @returns {string} Lowercased and trimmed string.
+ */
+const lowercaseTrim = (name) => name.toLowerCase().trim();
+
+/**
+ * Split array of languages in two columns.
+ *
+ * @template T Language object.
+ * @param {Array} arr Array of languages.
+ * @param {number} perChunk Number of languages per column.
+ * @returns {Array} Array of languages split in two columns.
+ */
+const chunkArray = (arr, perChunk) => {
+ return arr.reduce((resultArray, item, index) => {
+ const chunkIndex = Math.floor(index / perChunk);
+
+ if (!resultArray[chunkIndex]) {
+ // @ts-ignore
+ resultArray[chunkIndex] = []; // start a new chunk
+ }
+
+ // @ts-ignore
+ resultArray[chunkIndex].push(item);
+
+ return resultArray;
+ }, []);
+};
+
+/**
+ * Parse emoji from string.
+ *
+ * @param {string} str String to parse emoji from.
+ * @returns {string} String with emoji parsed.
+ */
+const parseEmojis = (str) => {
+ if (!str) {
+ throw new Error("[parseEmoji]: str argument not provided");
+ }
+ return str.replace(/:\w+:/gm, (emoji) => {
+ return toEmoji.get(emoji) || "";
+ });
+};
+
+/**
+ * Get diff in minutes between two dates.
+ *
+ * @param {Date} d1 First date.
+ * @param {Date} d2 Second date.
+ * @returns {number} Number of minutes between the two dates.
+ */
+const dateDiff = (d1, d2) => {
+ const date1 = new Date(d1);
+ const date2 = new Date(d2);
+ const diff = date1.getTime() - date2.getTime();
+ return Math.round(diff / (1000 * 60));
+};
+
+export {
+ parseBoolean,
+ parseArray,
+ clampValue,
+ lowercaseTrim,
+ chunkArray,
+ parseEmojis,
+ dateDiff,
+};
diff --git a/src/common/render.js b/src/common/render.js
new file mode 100644
index 0000000000000..594abaa549679
--- /dev/null
+++ b/src/common/render.js
@@ -0,0 +1,239 @@
+// @ts-check
+
+import { SECONDARY_ERROR_MESSAGES, TRY_AGAIN_LATER } from "./error.js";
+import { getCardColors } from "./color.js";
+import { encodeHTML } from "./html.js";
+import { clampValue } from "./ops.js";
+
+/**
+ * Auto layout utility, allows us to layout things vertically or horizontally with
+ * proper gaping.
+ *
+ * @param {object} props Function properties.
+ * @param {string[]} props.items Array of items to layout.
+ * @param {number} props.gap Gap between items.
+ * @param {"column" | "row"=} props.direction Direction to layout items.
+ * @param {number[]=} props.sizes Array of sizes for each item.
+ * @returns {string[]} Array of items with proper layout.
+ */
+const flexLayout = ({ items, gap, direction, sizes = [] }) => {
+ let lastSize = 0;
+ // filter() for filtering out empty strings
+ return items.filter(Boolean).map((item, i) => {
+ const size = sizes[i] || 0;
+ let transform = `translate(${lastSize}, 0)`;
+ if (direction === "column") {
+ transform = `translate(0, ${lastSize})`;
+ }
+ lastSize += size + gap;
+ return `${item}`;
+ });
+};
+
+/**
+ * Creates a node to display the primary programming language of the repository/gist.
+ *
+ * @param {string} langName Language name.
+ * @param {string} langColor Language color.
+ * @returns {string} Language display SVG object.
+ */
+const createLanguageNode = (langName, langColor) => {
+ return `
+
+
+ ${langName}
+
+ `;
+};
+
+/**
+ * Create a node to indicate progress in percentage along a horizontal line.
+ *
+ * @param {Object} params Object that contains the createProgressNode parameters.
+ * @param {number} params.x X-axis position.
+ * @param {number} params.y Y-axis position.
+ * @param {number} params.width Width of progress bar.
+ * @param {string} params.color Progress color.
+ * @param {number} params.progress Progress value.
+ * @param {string} params.progressBarBackgroundColor Progress bar bg color.
+ * @param {number} params.delay Delay before animation starts.
+ * @returns {string} Progress node.
+ */
+const createProgressNode = ({
+ x,
+ y,
+ width,
+ color,
+ progress,
+ progressBarBackgroundColor,
+ delay,
+}) => {
+ const progressPercentage = clampValue(progress, 2, 100);
+
+ return `
+
+
+
+
+
+
+ `;
+};
+
+/**
+ * Creates an icon with label to display repository/gist stats like forks, stars, etc.
+ *
+ * @param {string} icon The icon to display.
+ * @param {number|string} label The label to display.
+ * @param {string} testid The testid to assign to the label.
+ * @param {number} iconSize The size of the icon.
+ * @returns {string} Icon with label SVG object.
+ */
+const iconWithLabel = (icon, label, testid, iconSize) => {
+ if (typeof label === "number" && label <= 0) {
+ return "";
+ }
+ const iconSvg = `
+
+ ${icon}
+
+ `;
+ const text = `${label}`;
+ return flexLayout({ items: [iconSvg, text], gap: 20 }).join("");
+};
+
+// Script parameters.
+const ERROR_CARD_LENGTH = 576.5;
+
+const UPSTREAM_API_ERRORS = [
+ TRY_AGAIN_LATER,
+ SECONDARY_ERROR_MESSAGES.MAX_RETRY,
+];
+
+/**
+ * Renders error message on the card.
+ *
+ * @param {object} args Function arguments.
+ * @param {string} args.message Main error message.
+ * @param {string} [args.secondaryMessage=""] The secondary error message.
+ * @param {object} [args.renderOptions={}] Render options.
+ * @param {string=} args.renderOptions.title_color Card title color.
+ * @param {string=} args.renderOptions.text_color Card text color.
+ * @param {string=} args.renderOptions.bg_color Card background color.
+ * @param {string=} args.renderOptions.border_color Card border color.
+ * @param {Parameters[0]["theme"]=} args.renderOptions.theme Card theme.
+ * @param {boolean=} args.renderOptions.show_repo_link Whether to show repo link or not.
+ * @returns {string} The SVG markup.
+ */
+const renderError = ({
+ message,
+ secondaryMessage = "",
+ renderOptions = {},
+}) => {
+ const {
+ title_color,
+ text_color,
+ bg_color,
+ border_color,
+ theme = "default",
+ show_repo_link = true,
+ } = renderOptions;
+
+ // returns theme based colors with proper overrides and defaults
+ const { titleColor, textColor, bgColor, borderColor } = getCardColors({
+ title_color,
+ text_color,
+ icon_color: "",
+ bg_color,
+ border_color,
+ ring_color: "",
+ theme,
+ });
+
+ return `
+
+
+
+ Something went wrong!${
+ UPSTREAM_API_ERRORS.includes(secondaryMessage) || !show_repo_link
+ ? ""
+ : " file an issue at https://tiny.one/readme-stats"
+ }
+
+ ${encodeHTML(message)}
+ ${secondaryMessage}
+
+
+ `;
+};
+
+/**
+ * Retrieve text length.
+ *
+ * @see https://stackoverflow.com/a/48172630/10629172
+ * @param {string} str String to measure.
+ * @param {number} fontSize Font size.
+ * @returns {number} Text length.
+ */
+const measureText = (str, fontSize = 10) => {
+ // prettier-ignore
+ const widths = [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0.2796875, 0.2765625,
+ 0.3546875, 0.5546875, 0.5546875, 0.8890625, 0.665625, 0.190625,
+ 0.3328125, 0.3328125, 0.3890625, 0.5828125, 0.2765625, 0.3328125,
+ 0.2765625, 0.3015625, 0.5546875, 0.5546875, 0.5546875, 0.5546875,
+ 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875,
+ 0.2765625, 0.2765625, 0.584375, 0.5828125, 0.584375, 0.5546875,
+ 1.0140625, 0.665625, 0.665625, 0.721875, 0.721875, 0.665625,
+ 0.609375, 0.7765625, 0.721875, 0.2765625, 0.5, 0.665625,
+ 0.5546875, 0.8328125, 0.721875, 0.7765625, 0.665625, 0.7765625,
+ 0.721875, 0.665625, 0.609375, 0.721875, 0.665625, 0.94375,
+ 0.665625, 0.665625, 0.609375, 0.2765625, 0.3546875, 0.2765625,
+ 0.4765625, 0.5546875, 0.3328125, 0.5546875, 0.5546875, 0.5,
+ 0.5546875, 0.5546875, 0.2765625, 0.5546875, 0.5546875, 0.221875,
+ 0.240625, 0.5, 0.221875, 0.8328125, 0.5546875, 0.5546875,
+ 0.5546875, 0.5546875, 0.3328125, 0.5, 0.2765625, 0.5546875,
+ 0.5, 0.721875, 0.5, 0.5, 0.5, 0.3546875, 0.259375, 0.353125, 0.5890625,
+ ];
+
+ const avg = 0.5279276315789471;
+ return (
+ str
+ .split("")
+ .map((c) =>
+ c.charCodeAt(0) < widths.length ? widths[c.charCodeAt(0)] : avg,
+ )
+ .reduce((cur, acc) => acc + cur) * fontSize
+ );
+};
+
+export {
+ ERROR_CARD_LENGTH,
+ renderError,
+ createLanguageNode,
+ createProgressNode,
+ iconWithLabel,
+ flexLayout,
+ measureText,
+};
diff --git a/src/common/retryer.js b/src/common/retryer.js
index 3f294d3751327..6703415d92631 100644
--- a/src/common/retryer.js
+++ b/src/common/retryer.js
@@ -1,4 +1,7 @@
-import { CustomError, logger } from "./utils.js";
+// @ts-check
+
+import { CustomError } from "./error.js";
+import { logger } from "./log.js";
// Script variables.
@@ -10,41 +13,50 @@ const RETRIES = process.env.NODE_ENV === "test" ? 7 : PATs;
/**
* @typedef {import("axios").AxiosResponse} AxiosResponse Axios response.
- * @typedef {(variables: object, token: string) => Promise} FetcherFunction Fetcher function.
+ * @typedef {(variables: any, token: string, retriesForTests?: number) => Promise} FetcherFunction Fetcher function.
*/
/**
* Try to execute the fetcher function until it succeeds or the max number of retries is reached.
*
* @param {FetcherFunction} fetcher The fetcher function.
- * @param {object} variables Object with arguments to pass to the fetcher function.
+ * @param {any} variables Object with arguments to pass to the fetcher function.
* @param {number} retries How many times to retry.
- * @returns {Promise} The response from the fetcher function.
+ * @returns {Promise} The response from the fetcher function.
*/
const retryer = async (fetcher, variables, retries = 0) => {
if (!RETRIES) {
throw new CustomError("No GitHub API tokens found", CustomError.NO_TOKENS);
}
+
if (retries > RETRIES) {
throw new CustomError(
"Downtime due to GitHub API rate limiting",
CustomError.MAX_RETRY,
);
}
+
try {
// try to fetch with the first token since RETRIES is 0 index i'm adding +1
let response = await fetcher(
variables,
+ // @ts-ignore
process.env[`PAT_${retries + 1}`],
+ // used in tests for faking rate limit
retries,
);
- // prettier-ignore
- const isRateExceeded = response.data.errors && response.data.errors[0].type === "RATE_LIMITED";
+ // react on both type and message-based rate-limit signals.
+ // https://github.com/anuraghazra/github-readme-stats/issues/4425
+ const errors = response?.data?.errors;
+ const errorType = errors?.[0]?.type;
+ const errorMsg = errors?.[0]?.message || "";
+ const isRateLimited =
+ (errors && errorType === "RATE_LIMITED") || /rate limit/i.test(errorMsg);
// if rate limit is hit increase the RETRIES and recursively call the retryer
// with username, and current RETRIES
- if (isRateExceeded) {
+ if (isRateLimited) {
logger.log(`PAT_${retries + 1} Failed`);
retries++;
// directly return from the function
@@ -54,21 +66,30 @@ const retryer = async (fetcher, variables, retries = 0) => {
// finally return the response
return response;
} catch (err) {
+ /** @type {any} */
+ const e = err;
+
+ // network/unexpected error → let caller treat as failure
+ if (!e?.response) {
+ throw e;
+ }
+
// prettier-ignore
// also checking for bad credentials if any tokens gets invalidated
- const isBadCredential = err.response.data && err.response.data.message === "Bad credentials";
+ const isBadCredential =
+ e?.response?.data?.message === "Bad credentials";
const isAccountSuspended =
- err.response.data &&
- err.response.data.message === "Sorry. Your account was suspended.";
+ e?.response?.data?.message === "Sorry. Your account was suspended.";
if (isBadCredential || isAccountSuspended) {
logger.log(`PAT_${retries + 1} Failed`);
retries++;
// directly return from the function
return retryer(fetcher, variables, retries);
- } else {
- return err.response;
}
+
+ // HTTP error with a response → return it for caller-side handling
+ return e.response;
}
};
diff --git a/src/common/utils.js b/src/common/utils.js
deleted file mode 100644
index b780657c1c244..0000000000000
--- a/src/common/utils.js
+++ /dev/null
@@ -1,628 +0,0 @@
-// @ts-check
-import axios from "axios";
-import toEmoji from "emoji-name-map";
-import wrap from "word-wrap";
-import { themes } from "../../themes/index.js";
-
-const TRY_AGAIN_LATER = "Please try again later";
-
-const SECONDARY_ERROR_MESSAGES = {
- MAX_RETRY:
- "You can deploy own instance or wait until public will be no longer limited",
- NO_TOKENS:
- "Please add an env variable called PAT_1 with your GitHub API token in vercel",
- USER_NOT_FOUND: "Make sure the provided username is not an organization",
- GRAPHQL_ERROR: TRY_AGAIN_LATER,
- GITHUB_REST_API_ERROR: TRY_AGAIN_LATER,
- WAKATIME_USER_NOT_FOUND: "Make sure you have a public WakaTime profile",
-};
-
-/**
- * Custom error class to handle custom GRS errors.
- */
-class CustomError extends Error {
- /**
- * @param {string} message Error message.
- * @param {string} type Error type.
- */
- constructor(message, type) {
- super(message);
- this.type = type;
- this.secondaryMessage = SECONDARY_ERROR_MESSAGES[type] || type;
- }
-
- static MAX_RETRY = "MAX_RETRY";
- static NO_TOKENS = "NO_TOKENS";
- static USER_NOT_FOUND = "USER_NOT_FOUND";
- static GRAPHQL_ERROR = "GRAPHQL_ERROR";
- static GITHUB_REST_API_ERROR = "GITHUB_REST_API_ERROR";
- static WAKATIME_ERROR = "WAKATIME_ERROR";
-}
-
-/**
- * Auto layout utility, allows us to layout things vertically or horizontally with
- * proper gaping.
- *
- * @param {object} props Function properties.
- * @param {string[]} props.items Array of items to layout.
- * @param {number} props.gap Gap between items.
- * @param {"column" | "row"=} props.direction Direction to layout items.
- * @param {number[]=} props.sizes Array of sizes for each item.
- * @returns {string[]} Array of items with proper layout.
- */
-const flexLayout = ({ items, gap, direction, sizes = [] }) => {
- let lastSize = 0;
- // filter() for filtering out empty strings
- return items.filter(Boolean).map((item, i) => {
- const size = sizes[i] || 0;
- let transform = `translate(${lastSize}, 0)`;
- if (direction === "column") {
- transform = `translate(0, ${lastSize})`;
- }
- lastSize += size + gap;
- return `${item}`;
- });
-};
-
-/**
- * Creates a node to display the primary programming language of the repository/gist.
- *
- * @param {string} langName Language name.
- * @param {string} langColor Language color.
- * @returns {string} Language display SVG object.
- */
-const createLanguageNode = (langName, langColor) => {
- return `
-
-
- ${langName}
-
- `;
-};
-
-/**
- * Creates an icon with label to display repository/gist stats like forks, stars, etc.
- *
- * @param {string} icon The icon to display.
- * @param {number|string} label The label to display.
- * @param {string} testid The testid to assign to the label.
- * @param {number} iconSize The size of the icon.
- * @returns {string} Icon with label SVG object.
- */
-const iconWithLabel = (icon, label, testid, iconSize) => {
- if (typeof label === "number" && label <= 0) {
- return "";
- }
- const iconSvg = `
-
- ${icon}
-
- `;
- const text = `${label}`;
- return flexLayout({ items: [iconSvg, text], gap: 20 }).join("");
-};
-
-/**
- * Retrieves num with suffix k(thousands) precise to 1 decimal if greater than 999.
- *
- * @param {number} num The number to format.
- * @returns {string|number} The formatted number.
- */
-const kFormatter = (num) => {
- return Math.abs(num) > 999
- ? Math.sign(num) * parseFloat((Math.abs(num) / 1000).toFixed(1)) + "k"
- : Math.sign(num) * Math.abs(num);
-};
-
-/**
- * Checks if a string is a valid hex color.
- *
- * @param {string} hexColor String to check.
- * @returns {boolean} True if the given string is a valid hex color.
- */
-const isValidHexColor = (hexColor) => {
- return new RegExp(
- /^([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{4})$/,
- ).test(hexColor);
-};
-
-/**
- * Returns boolean if value is either "true" or "false" else the value as it is.
- *
- * @param {string | boolean} value The value to parse.
- * @returns {boolean | undefined } The parsed value.
- */
-const parseBoolean = (value) => {
- if (typeof value === "boolean") {
- return value;
- }
-
- if (typeof value === "string") {
- if (value.toLowerCase() === "true") {
- return true;
- } else if (value.toLowerCase() === "false") {
- return false;
- }
- }
- return undefined;
-};
-
-/**
- * Parse string to array of strings.
- *
- * @param {string} str The string to parse.
- * @returns {string[]} The array of strings.
- */
-const parseArray = (str) => {
- if (!str) {
- return [];
- }
- return str.split(",");
-};
-
-/**
- * Clamp the given number between the given range.
- *
- * @param {number} number The number to clamp.
- * @param {number} min The minimum value.
- * @param {number} max The maximum value.
- * @returns {number} The clamped number.
- */
-const clampValue = (number, min, max) => {
- // @ts-ignore
- if (Number.isNaN(parseInt(number, 10))) {
- return min;
- }
- return Math.max(min, Math.min(number, max));
-};
-
-/**
- * Check if the given string is a valid gradient.
- *
- * @param {string[]} colors Array of colors.
- * @returns {boolean} True if the given string is a valid gradient.
- */
-const isValidGradient = (colors) => {
- return (
- colors.length > 2 &&
- colors.slice(1).every((color) => isValidHexColor(color))
- );
-};
-
-/**
- * Retrieves a gradient if color has more than one valid hex codes else a single color.
- *
- * @param {string} color The color to parse.
- * @param {string | string[]} fallbackColor The fallback color.
- * @returns {string | string[]} The gradient or color.
- */
-const fallbackColor = (color, fallbackColor) => {
- let gradient = null;
-
- let colors = color ? color.split(",") : [];
- if (colors.length > 1 && isValidGradient(colors)) {
- gradient = colors;
- }
-
- return (
- (gradient ? gradient : isValidHexColor(color) && `#${color}`) ||
- fallbackColor
- );
-};
-
-/**
- * @typedef {import('axios').AxiosRequestConfig['data']} AxiosRequestConfigData Axios request data.
- * @typedef {import('axios').AxiosRequestConfig['headers']} AxiosRequestConfigHeaders Axios request headers.
- */
-
-/**
- * Send GraphQL request to GitHub API.
- *
- * @param {AxiosRequestConfigData} data Request data.
- * @param {AxiosRequestConfigHeaders} headers Request headers.
- * @returns {Promise} Request response.
- */
-const request = (data, headers) => {
- return axios({
- url: "https://api.github.com/graphql",
- method: "post",
- headers,
- data,
- });
-};
-
-/**
- * Object containing card colors.
- * @typedef {{
- * titleColor: string;
- * iconColor: string;
- * textColor: string;
- * bgColor: string | string[];
- * borderColor: string;
- * ringColor: string;
- * }} CardColors
- */
-
-/**
- * Returns theme based colors with proper overrides and defaults.
- *
- * @param {Object} args Function arguments.
- * @param {string=} args.title_color Card title color.
- * @param {string=} args.text_color Card text color.
- * @param {string=} args.icon_color Card icon color.
- * @param {string=} args.bg_color Card background color.
- * @param {string=} args.border_color Card border color.
- * @param {string=} args.ring_color Card ring color.
- * @param {string=} args.theme Card theme.
- * @param {string=} args.fallbackTheme Fallback theme.
- * @returns {CardColors} Card colors.
- */
-const getCardColors = ({
- title_color,
- text_color,
- icon_color,
- bg_color,
- border_color,
- ring_color,
- theme,
- fallbackTheme = "default",
-}) => {
- const defaultTheme = themes[fallbackTheme];
- const selectedTheme = themes[theme] || defaultTheme;
- const defaultBorderColor =
- selectedTheme.border_color || defaultTheme.border_color;
-
- // get the color provided by the user else the theme color
- // finally if both colors are invalid fallback to default theme
- const titleColor = fallbackColor(
- title_color || selectedTheme.title_color,
- "#" + defaultTheme.title_color,
- );
-
- // get the color provided by the user else the theme color
- // finally if both colors are invalid we use the titleColor
- const ringColor = fallbackColor(
- ring_color || selectedTheme.ring_color,
- titleColor,
- );
- const iconColor = fallbackColor(
- icon_color || selectedTheme.icon_color,
- "#" + defaultTheme.icon_color,
- );
- const textColor = fallbackColor(
- text_color || selectedTheme.text_color,
- "#" + defaultTheme.text_color,
- );
- const bgColor = fallbackColor(
- bg_color || selectedTheme.bg_color,
- "#" + defaultTheme.bg_color,
- );
-
- const borderColor = fallbackColor(
- border_color || defaultBorderColor,
- "#" + defaultBorderColor,
- );
-
- if (
- typeof titleColor !== "string" ||
- typeof textColor !== "string" ||
- typeof ringColor !== "string" ||
- typeof iconColor !== "string" ||
- typeof borderColor !== "string"
- ) {
- throw new Error(
- "Unexpected behavior, all colors except background should be string.",
- );
- }
-
- return { titleColor, iconColor, textColor, bgColor, borderColor, ringColor };
-};
-
-// Script parameters.
-const ERROR_CARD_LENGTH = 576.5;
-
-/**
- * Encode string as HTML.
- *
- * @see https://stackoverflow.com/a/48073476/10629172
- *
- * @param {string} str String to encode.
- * @returns {string} Encoded string.
- */
-const encodeHTML = (str) => {
- return str
- .replace(/[\u00A0-\u9999<>&](?!#)/gim, (i) => {
- return "" + i.charCodeAt(0) + ";";
- })
- .replace(/\u0008/gim, "");
-};
-
-const UPSTREAM_API_ERRORS = [
- TRY_AGAIN_LATER,
- SECONDARY_ERROR_MESSAGES.MAX_RETRY,
-];
-
-/**
- * Renders error message on the card.
- *
- * @param {string} message Main error message.
- * @param {string} secondaryMessage The secondary error message.
- * @param {object} options Function options.
- * @returns {string} The SVG markup.
- */
-const renderError = (message, secondaryMessage = "", options = {}) => {
- const {
- title_color,
- text_color,
- bg_color,
- border_color,
- theme = "default",
- } = options;
-
- // returns theme based colors with proper overrides and defaults
- const { titleColor, textColor, bgColor, borderColor } = getCardColors({
- title_color,
- text_color,
- icon_color: "",
- bg_color,
- border_color,
- ring_color: "",
- theme,
- });
-
- return `
-
-
-
- Something went wrong!${
- UPSTREAM_API_ERRORS.includes(secondaryMessage)
- ? ""
- : " file an issue at https://tiny.one/readme-stats"
- }
-
- ${encodeHTML(message)}
- ${secondaryMessage}
-
-
- `;
-};
-
-/**
- * Split text over multiple lines based on the card width.
- *
- * @param {string} text Text to split.
- * @param {number} width Line width in number of characters.
- * @param {number} maxLines Maximum number of lines.
- * @returns {string[]} Array of lines.
- */
-const wrapTextMultiline = (text, width = 59, maxLines = 3) => {
- const fullWidthComma = ",";
- const encoded = encodeHTML(text);
- const isChinese = encoded.includes(fullWidthComma);
-
- let wrapped = [];
-
- if (isChinese) {
- wrapped = encoded.split(fullWidthComma); // Chinese full punctuation
- } else {
- wrapped = wrap(encoded, {
- width,
- }).split("\n"); // Split wrapped lines to get an array of lines
- }
-
- const lines = wrapped.map((line) => line.trim()).slice(0, maxLines); // Only consider maxLines lines
-
- // Add "..." to the last line if the text exceeds maxLines
- if (wrapped.length > maxLines) {
- lines[maxLines - 1] += "...";
- }
-
- // Remove empty lines if text fits in less than maxLines lines
- const multiLineText = lines.filter(Boolean);
- return multiLineText;
-};
-
-const noop = () => {};
-// return console instance based on the environment
-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 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 CONSTANTS = {
- ONE_MINUTE,
- FIVE_MINUTES,
- TEN_MINUTES,
- FIFTEEN_MINUTES,
- THIRTY_MINUTES,
- TWO_HOURS,
- FOUR_HOURS,
- SIX_HOURS,
- EIGHT_HOURS,
- TWELVE_HOURS,
- ONE_DAY,
- TWO_DAY,
- SIX_DAY,
- TEN_DAY,
- CARD_CACHE_SECONDS: ONE_DAY,
- TOP_LANGS_CACHE_SECONDS: SIX_DAY,
- PIN_CARD_CACHE_SECONDS: TEN_DAY,
- ERROR_CACHE_SECONDS: TEN_MINUTES,
-};
-
-/**
- * Missing query parameter class.
- */
-class MissingParamError extends Error {
- /**
- * Missing query parameter error constructor.
- *
- * @param {string[]} missedParams An array of missing parameters names.
- * @param {string=} secondaryMessage Optional secondary message to display.
- */
- constructor(missedParams, secondaryMessage) {
- const msg = `Missing params ${missedParams
- .map((p) => `"${p}"`)
- .join(", ")} make sure you pass the parameters in URL`;
- super(msg);
- this.missedParams = missedParams;
- this.secondaryMessage = secondaryMessage;
- }
-}
-
-/**
- * Retrieve text length.
- *
- * @see https://stackoverflow.com/a/48172630/10629172
- * @param {string} str String to measure.
- * @param {number} fontSize Font size.
- * @returns {number} Text length.
- */
-const measureText = (str, fontSize = 10) => {
- // prettier-ignore
- const widths = [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0.2796875, 0.2765625,
- 0.3546875, 0.5546875, 0.5546875, 0.8890625, 0.665625, 0.190625,
- 0.3328125, 0.3328125, 0.3890625, 0.5828125, 0.2765625, 0.3328125,
- 0.2765625, 0.3015625, 0.5546875, 0.5546875, 0.5546875, 0.5546875,
- 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875,
- 0.2765625, 0.2765625, 0.584375, 0.5828125, 0.584375, 0.5546875,
- 1.0140625, 0.665625, 0.665625, 0.721875, 0.721875, 0.665625,
- 0.609375, 0.7765625, 0.721875, 0.2765625, 0.5, 0.665625,
- 0.5546875, 0.8328125, 0.721875, 0.7765625, 0.665625, 0.7765625,
- 0.721875, 0.665625, 0.609375, 0.721875, 0.665625, 0.94375,
- 0.665625, 0.665625, 0.609375, 0.2765625, 0.3546875, 0.2765625,
- 0.4765625, 0.5546875, 0.3328125, 0.5546875, 0.5546875, 0.5,
- 0.5546875, 0.5546875, 0.2765625, 0.5546875, 0.5546875, 0.221875,
- 0.240625, 0.5, 0.221875, 0.8328125, 0.5546875, 0.5546875,
- 0.5546875, 0.5546875, 0.3328125, 0.5, 0.2765625, 0.5546875,
- 0.5, 0.721875, 0.5, 0.5, 0.5, 0.3546875, 0.259375, 0.353125, 0.5890625,
- ];
-
- const avg = 0.5279276315789471;
- return (
- str
- .split("")
- .map((c) =>
- c.charCodeAt(0) < widths.length ? widths[c.charCodeAt(0)] : avg,
- )
- .reduce((cur, acc) => acc + cur) * fontSize
- );
-};
-
-/**
- * Lowercase and trim string.
- *
- * @param {string} name String to lowercase and trim.
- * @returns {string} Lowercased and trimmed string.
- */
-const lowercaseTrim = (name) => name.toLowerCase().trim();
-
-/**
- * Split array of languages in two columns.
- *
- * @template T Language object.
- * @param {Array} arr Array of languages.
- * @param {number} perChunk Number of languages per column.
- * @returns {Array} Array of languages split in two columns.
- */
-const chunkArray = (arr, perChunk) => {
- return arr.reduce((resultArray, item, index) => {
- const chunkIndex = Math.floor(index / perChunk);
-
- if (!resultArray[chunkIndex]) {
- // @ts-ignore
- resultArray[chunkIndex] = []; // start a new chunk
- }
-
- // @ts-ignore
- resultArray[chunkIndex].push(item);
-
- return resultArray;
- }, []);
-};
-
-/**
- * Parse emoji from string.
- *
- * @param {string} str String to parse emoji from.
- * @returns {string} String with emoji parsed.
- */
-const parseEmojis = (str) => {
- if (!str) {
- throw new Error("[parseEmoji]: str argument not provided");
- }
- return str.replace(/:\w+:/gm, (emoji) => {
- return toEmoji.get(emoji) || "";
- });
-};
-
-/**
- * Get diff in minutes between two dates.
- *
- * @param {Date} d1 First date.
- * @param {Date} d2 Second date.
- * @returns {number} Number of minutes between the two dates.
- */
-const dateDiff = (d1, d2) => {
- const date1 = new Date(d1);
- const date2 = new Date(d2);
- const diff = date1.getTime() - date2.getTime();
- return Math.round(diff / (1000 * 60));
-};
-
-export {
- ERROR_CARD_LENGTH,
- renderError,
- createLanguageNode,
- iconWithLabel,
- encodeHTML,
- kFormatter,
- isValidHexColor,
- parseBoolean,
- parseArray,
- clampValue,
- isValidGradient,
- fallbackColor,
- request,
- flexLayout,
- getCardColors,
- wrapTextMultiline,
- logger,
- CONSTANTS,
- CustomError,
- MissingParamError,
- measureText,
- lowercaseTrim,
- chunkArray,
- parseEmojis,
- dateDiff,
-};
diff --git a/src/fetchers/gist-fetcher.js b/src/fetchers/gist.js
similarity index 86%
rename from src/fetchers/gist-fetcher.js
rename to src/fetchers/gist.js
index 4e0e0f5e7e4f2..d9cccc6761e99 100644
--- a/src/fetchers/gist-fetcher.js
+++ b/src/fetchers/gist.js
@@ -1,12 +1,8 @@
// @ts-check
-import { request, MissingParamError } from "../common/utils.js";
import { retryer } from "../common/retryer.js";
-
-/**
- * @typedef {import('axios').AxiosRequestHeaders} AxiosRequestHeaders Axios request headers.
- * @typedef {import('axios').AxiosResponse} AxiosResponse Axios response.
- */
+import { MissingParamError } from "../common/error.js";
+import { request } from "../common/http.js";
const QUERY = `
query gistInfo($gistName: String!) {
@@ -35,9 +31,9 @@ query gistInfo($gistName: String!) {
/**
* Gist data fetcher.
*
- * @param {AxiosRequestHeaders} variables Fetcher variables.
+ * @param {object} variables Fetcher variables.
* @param {string} token GitHub token.
- * @returns {Promise} The response.
+ * @returns {Promise} The response.
*/
const fetcher = async (variables, token) => {
return await request(
@@ -57,7 +53,9 @@ const fetcher = async (variables, token) => {
* @returns {string} Primary language.
*/
const calculatePrimaryLanguage = (files) => {
+ /** @type {Record} */
const languages = {};
+
for (const file of files) {
if (file.language) {
if (languages[file.language.name]) {
@@ -67,12 +65,14 @@ const calculatePrimaryLanguage = (files) => {
}
}
}
+
let primaryLanguage = Object.keys(languages)[0];
for (const language in languages) {
if (languages[language] > languages[primaryLanguage]) {
primaryLanguage = language;
}
}
+
return primaryLanguage;
};
@@ -83,7 +83,7 @@ const calculatePrimaryLanguage = (files) => {
/**
* Fetch GitHub gist information by given username and ID.
*
- * @param {string} id Github gist ID.
+ * @param {string} id GitHub gist ID.
* @returns {Promise} Gist data.
*/
const fetchGist = async (id) => {
diff --git a/src/fetchers/repo-fetcher.js b/src/fetchers/repo.js
similarity index 87%
rename from src/fetchers/repo-fetcher.js
rename to src/fetchers/repo.js
index 6438f8895cfb6..304aba5fdc23c 100644
--- a/src/fetchers/repo-fetcher.js
+++ b/src/fetchers/repo.js
@@ -1,18 +1,15 @@
// @ts-check
-import { retryer } from "../common/retryer.js";
-import { MissingParamError, request } from "../common/utils.js";
-/**
- * @typedef {import('axios').AxiosRequestHeaders} AxiosRequestHeaders Axios request headers.
- * @typedef {import('axios').AxiosResponse} AxiosResponse Axios response.
- */
+import { MissingParamError } from "../common/error.js";
+import { request } from "../common/http.js";
+import { retryer } from "../common/retryer.js";
/**
* Repo data fetcher.
*
- * @param {AxiosRequestHeaders} variables Fetcher variables.
+ * @param {object} variables Fetcher variables.
* @param {string} token GitHub token.
- * @returns {Promise} The response.
+ * @returns {Promise} The response.
*/
const fetcher = (variables, token) => {
return request(
diff --git a/src/fetchers/stats-fetcher.js b/src/fetchers/stats.js
similarity index 81%
rename from src/fetchers/stats-fetcher.js
rename to src/fetchers/stats.js
index 115cd50a51564..376a15816144e 100644
--- a/src/fetchers/stats-fetcher.js
+++ b/src/fetchers/stats.js
@@ -1,16 +1,15 @@
// @ts-check
+
import axios from "axios";
import * as dotenv from "dotenv";
import githubUsernameRegex from "github-username-regex";
import { calculateRank } from "../calculateRank.js";
import { retryer } from "../common/retryer.js";
-import {
- CustomError,
- logger,
- MissingParamError,
- request,
- wrapTextMultiline,
-} from "../common/utils.js";
+import { logger } from "../common/log.js";
+import { excludeRepositories } from "../common/envs.js";
+import { CustomError, MissingParamError } from "../common/error.js";
+import { wrapTextMultiline } from "../common/fmt.js";
+import { request } from "../common/http.js";
dotenv.config();
@@ -40,12 +39,14 @@ const GRAPHQL_REPOS_QUERY = `
`;
const GRAPHQL_STATS_QUERY = `
- query userInfo($login: String!, $after: String, $includeMergedPullRequests: Boolean!, $includeDiscussions: Boolean!, $includeDiscussionsAnswers: Boolean!) {
+ query userInfo($login: String!, $after: String, $includeMergedPullRequests: Boolean!, $includeDiscussions: Boolean!, $includeDiscussionsAnswers: Boolean!, $startTime: DateTime = null) {
user(login: $login) {
name
login
- contributionsCollection {
+ commits: contributionsCollection (from: $startTime) {
totalCommitContributions,
+ }
+ reviews: contributionsCollection {
totalPullRequestReviewContributions
}
repositoriesContributedTo(first: 1, contributionTypes: [COMMIT, ISSUE, PULL_REQUEST, REPOSITORY]) {
@@ -77,16 +78,12 @@ const GRAPHQL_STATS_QUERY = `
}
`;
-/**
- * @typedef {import('axios').AxiosResponse} AxiosResponse Axios response.
- */
-
/**
* Stats fetcher object.
*
- * @param {object} variables Fetcher variables.
+ * @param {object & { after: string | null }} variables Fetcher variables.
* @param {string} token GitHub token.
- * @returns {Promise} Axios response.
+ * @returns {Promise} Axios response.
*/
const fetcher = (variables, token) => {
const query = variables.after ? GRAPHQL_REPOS_QUERY : GRAPHQL_STATS_QUERY;
@@ -105,11 +102,12 @@ const fetcher = (variables, token) => {
* Fetch stats information for a given username.
*
* @param {object} variables Fetcher variables.
- * @param {string} variables.username Github username.
+ * @param {string} variables.username GitHub username.
* @param {boolean} variables.includeMergedPullRequests Include merged pull requests.
* @param {boolean} variables.includeDiscussions Include discussions.
* @param {boolean} variables.includeDiscussionsAnswers Include discussions answers.
- * @returns {Promise} Axios response.
+ * @param {string|undefined} variables.startTime Time to start the count of total commits.
+ * @returns {Promise} Axios response.
*
* @description This function supports multi-page fetching if the 'FETCH_MULTI_PAGE_STARS' environment variable is set to true.
*/
@@ -118,6 +116,7 @@ const statsFetcher = async ({
includeMergedPullRequests,
includeDiscussions,
includeDiscussionsAnswers,
+ startTime,
}) => {
let stats;
let hasNextPage = true;
@@ -130,6 +129,7 @@ const statsFetcher = async ({
includeMergedPullRequests,
includeDiscussions,
includeDiscussionsAnswers,
+ startTime,
};
let res = await retryer(fetcher, variables);
if (res.data.errors) {
@@ -158,6 +158,27 @@ const statsFetcher = async ({
return stats;
};
+/**
+ * Fetch total commits using the REST API.
+ *
+ * @param {object} variables Fetcher variables.
+ * @param {string} token GitHub token.
+ * @returns {Promise} Axios response.
+ *
+ * @see https://developer.github.com/v3/search/#search-commits
+ */
+const fetchTotalCommits = (variables, token) => {
+ return axios({
+ method: "get",
+ url: `https://api.github.com/search/commits?q=author:${variables.login}`,
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/vnd.github.cloak-preview",
+ Authorization: `token ${token}`,
+ },
+ });
+};
+
/**
* Fetch all the commits for all the repositories of a given username.
*
@@ -173,19 +194,6 @@ const totalCommitsFetcher = async (username) => {
throw new Error("Invalid username provided.");
}
- // https://developer.github.com/v3/search/#search-commits
- const fetchTotalCommits = (variables, token) => {
- return axios({
- method: "get",
- url: `https://api.github.com/search/commits?q=author:${variables.login}`,
- headers: {
- "Content-Type": "application/json",
- Accept: "application/vnd.github.cloak-preview",
- Authorization: `token ${token}`,
- },
- });
- };
-
let res;
try {
res = await retryer(fetchTotalCommits, { login: username });
@@ -204,10 +212,6 @@ const totalCommitsFetcher = async (username) => {
return totalCount;
};
-/**
- * @typedef {import("./types").StatsData} StatsData Stats data.
- */
-
/**
* Fetch stats for a given username.
*
@@ -217,7 +221,8 @@ const totalCommitsFetcher = async (username) => {
* @param {boolean} include_merged_pull_requests Include merged pull requests.
* @param {boolean} include_discussions Include discussions.
* @param {boolean} include_discussions_answers Include discussions answers.
- * @returns {Promise} Stats data.
+ * @param {number|undefined} commits_year Year to count total commits
+ * @returns {Promise} Stats data.
*/
const fetchStats = async (
username,
@@ -226,6 +231,7 @@ const fetchStats = async (
include_merged_pull_requests = false,
include_discussions = false,
include_discussions_answers = false,
+ commits_year,
) => {
if (!username) {
throw new MissingParamError(["username"]);
@@ -251,6 +257,7 @@ const fetchStats = async (
includeMergedPullRequests: include_merged_pull_requests,
includeDiscussions: include_discussions,
includeDiscussionsAnswers: include_discussions_answers,
+ startTime: commits_year ? `${commits_year}-01-01T00:00:00Z` : undefined,
});
// Catch GraphQL errors.
@@ -282,17 +289,17 @@ const fetchStats = async (
if (include_all_commits) {
stats.totalCommits = await totalCommitsFetcher(username);
} else {
- stats.totalCommits = user.contributionsCollection.totalCommitContributions;
+ stats.totalCommits = user.commits.totalCommitContributions;
}
stats.totalPRs = user.pullRequests.totalCount;
if (include_merged_pull_requests) {
stats.totalPRsMerged = user.mergedPullRequests.totalCount;
stats.mergedPRsPercentage =
- (user.mergedPullRequests.totalCount / user.pullRequests.totalCount) * 100;
+ (user.mergedPullRequests.totalCount / user.pullRequests.totalCount) *
+ 100 || 0;
}
- stats.totalReviews =
- user.contributionsCollection.totalPullRequestReviewContributions;
+ stats.totalReviews = user.reviews.totalPullRequestReviewContributions;
stats.totalIssues = user.openIssues.totalCount + user.closedIssues.totalCount;
if (include_discussions) {
stats.totalDiscussionsStarted = user.repositoryDiscussions.totalCount;
@@ -304,7 +311,8 @@ const fetchStats = async (
stats.contributedTo = user.repositoriesContributedTo.totalCount;
// Retrieve stars while filtering out repositories to be hidden.
- let repoToHide = new Set(exclude_repo);
+ const allExcludedRepos = [...exclude_repo, ...excludeRepositories];
+ let repoToHide = new Set(allExcludedRepos);
stats.totalStars = user.repositories.nodes
.filter((data) => {
diff --git a/src/fetchers/top-languages-fetcher.js b/src/fetchers/top-languages.js
similarity index 87%
rename from src/fetchers/top-languages-fetcher.js
rename to src/fetchers/top-languages.js
index 485cc8b75de8a..91e3618f97716 100644
--- a/src/fetchers/top-languages-fetcher.js
+++ b/src/fetchers/top-languages.js
@@ -1,24 +1,18 @@
// @ts-check
-import { retryer } from "../common/retryer.js";
-import {
- CustomError,
- logger,
- MissingParamError,
- request,
- wrapTextMultiline,
-} from "../common/utils.js";
-/**
- * @typedef {import("axios").AxiosRequestHeaders} AxiosRequestHeaders Axios request headers.
- * @typedef {import("axios").AxiosResponse} AxiosResponse Axios response.
- */
+import { retryer } from "../common/retryer.js";
+import { logger } from "../common/log.js";
+import { excludeRepositories } from "../common/envs.js";
+import { CustomError, MissingParamError } from "../common/error.js";
+import { wrapTextMultiline } from "../common/fmt.js";
+import { request } from "../common/http.js";
/**
* Top languages fetcher object.
*
- * @param {AxiosRequestHeaders} variables Fetcher variables.
+ * @param {any} variables Fetcher variables.
* @param {string} token GitHub token.
- * @returns {Promise} Languages fetcher response.
+ * @returns {Promise} Languages fetcher response.
*/
const fetcher = (variables, token) => {
return request(
@@ -98,12 +92,14 @@ const fetchTopLanguages = async (
}
let repoNodes = res.data.data.user.repositories.nodes;
+ /** @type {Record} */
let repoToHide = {};
+ const allExcludedRepos = [...exclude_repo, ...excludeRepositories];
// populate repoToHide map for quick lookup
// while filtering out
- if (exclude_repo) {
- exclude_repo.forEach((repoName) => {
+ if (allExcludedRepos) {
+ allExcludedRepos.forEach((repoName) => {
repoToHide[repoName] = true;
});
}
diff --git a/src/fetchers/wakatime-fetcher.js b/src/fetchers/wakatime.js
similarity index 84%
rename from src/fetchers/wakatime-fetcher.js
rename to src/fetchers/wakatime.js
index f69d6ae498eef..a081dbd2dc07d 100644
--- a/src/fetchers/wakatime-fetcher.js
+++ b/src/fetchers/wakatime.js
@@ -1,11 +1,13 @@
+// @ts-check
+
import axios from "axios";
-import { CustomError, MissingParamError } from "../common/utils.js";
+import { CustomError, MissingParamError } from "../common/error.js";
/**
* WakaTime data fetcher.
*
* @param {{username: string, api_domain: string }} props Fetcher props.
- * @returns {Promise} WakaTime data response.
+ * @returns {Promise} WakaTime data response.
*/
const fetchWakatimeStats = async ({ username, api_domain }) => {
if (!username) {
diff --git a/src/translations.js b/src/translations.js
index aa8744d7e1391..ad069cc407813 100644
--- a/src/translations.js
+++ b/src/translations.js
@@ -1,6 +1,6 @@
// @ts-check
-import { encodeHTML } from "./common/utils.js";
+import { encodeHTML } from "./common/html.js";
/**
* Retrieves stat card labels in the available locales.
@@ -16,15 +16,24 @@ const statCardLocales = ({ name, apostrophe }) => {
const encodedName = encodeHTML(name);
return {
"statcard.title": {
- ar: `${encodedName} إحصائيات غيت هاب`,
+ en: `${encodedName}'${apostrophe} GitHub Stats`,
+ ar: `${encodedName} إحصائيات جيت هاب`,
+ az: `${encodedName}'${apostrophe} Hesabının GitHub Statistikası`,
+ ca: `Estadístiques de GitHub de ${encodedName}`,
cn: `${encodedName} 的 GitHub 统计数据`,
- "zh-tw": `${encodedName} 的 GitHub 統計數據`,
+ "zh-tw": `${encodedName} 的 GitHub 統計資料`,
cs: `GitHub statistiky uživatele ${encodedName}`,
de: `${encodedName + apostrophe} GitHub-Statistiken`,
- en: `${encodedName}'${apostrophe} GitHub Stats`,
+ sw: `GitHub Stats za ${encodedName}`,
+ ur: `${encodedName} کے گٹ ہب کے اعداد و شمار`,
+ bg: `GitHub статистика на потребител ${encodedName}`,
bn: `${encodedName} এর GitHub পরিসংখ্যান`,
es: `Estadísticas de GitHub de ${encodedName}`,
+ fa: `آمار گیتهاب ${encodedName}`,
+ fi: `${encodedName}:n GitHub-tilastot`,
fr: `Statistiques GitHub de ${encodedName}`,
+ hi: `${encodedName} के GitHub आँकड़े`,
+ sa: `${encodedName} इत्यस्य GitHub सांख्यिकी`,
hu: `${encodedName} GitHub statisztika`,
it: `Statistiche GitHub di ${encodedName}`,
ja: `${encodedName}の GitHub 統計`,
@@ -34,28 +43,45 @@ const statCardLocales = ({ name, apostrophe }) => {
"pt-br": `Estatísticas do GitHub de ${encodedName}`,
np: `${encodedName}'${apostrophe} गिटहब तथ्याङ्क`,
el: `Στατιστικά GitHub του ${encodedName}`,
+ ro: `Statisticile GitHub ale lui ${encodedName}`,
ru: `Статистика GitHub пользователя ${encodedName}`,
"uk-ua": `Статистика GitHub користувача ${encodedName}`,
id: `Statistik GitHub ${encodedName}`,
ml: `${encodedName}'${apostrophe} ഗിറ്റ്ഹബ് സ്ഥിതിവിവരക്കണക്കുകൾ`,
- my: `Statistik GitHub ${encodedName}`,
+ my: `${encodedName} ရဲ့ GitHub အခြေအနေများ`,
+ ta: `${encodedName} கிட்ஹப் புள்ளிவிவரங்கள்`,
sk: `GitHub štatistiky používateľa ${encodedName}`,
- tr: `${encodedName} Hesabının GitHub Yıldızları`,
+ tr: `${encodedName} Hesabının GitHub İstatistikleri`,
pl: `Statystyki GitHub użytkownika ${encodedName}`,
uz: `${encodedName}ning GitHub'dagi statistikasi`,
vi: `Thống Kê GitHub ${encodedName}`,
se: `GitHubstatistik för ${encodedName}`,
+ he: `סטטיסטיקות הגיטהאב של ${encodedName}`,
+ fil: `Mga Stats ng GitHub ni ${encodedName}`,
+ th: `สถิติ GitHub ของ ${encodedName}`,
+ sr: `GitHub статистика корисника ${encodedName}`,
+ "sr-latn": `GitHub statistika korisnika ${encodedName}`,
+ no: `GitHub-statistikk for ${encodedName}`,
},
"statcard.ranktitle": {
- ar: `${encodedName} إحصائيات غيت هاب`,
+ en: `${encodedName}'${apostrophe} GitHub Rank`,
+ ar: `${encodedName} إحصائيات جيت هاب`,
+ az: `${encodedName}'${apostrophe} Hesabının GitHub Statistikası`,
+ ca: `Estadístiques de GitHub de ${encodedName}`,
cn: `${encodedName} 的 GitHub 统计数据`,
- "zh-tw": `${encodedName} 的 GitHub 統計數據`,
+ "zh-tw": `${encodedName} 的 GitHub 統計資料`,
cs: `GitHub statistiky uživatele ${encodedName}`,
de: `${encodedName + apostrophe} GitHub-Statistiken`,
- en: `${encodedName}'${apostrophe} GitHub Rank`,
+ sw: `GitHub Rank ya ${encodedName}`,
+ ur: `${encodedName} کی گٹ ہب رینک`,
+ bg: `GitHub ранг на ${encodedName}`,
bn: `${encodedName} এর GitHub পরিসংখ্যান`,
es: `Estadísticas de GitHub de ${encodedName}`,
+ fa: `رتبه گیتهاب ${encodedName}`,
+ fi: `${encodedName}:n GitHub-sijoitus`,
fr: `Statistiques GitHub de ${encodedName}`,
+ hi: `${encodedName} का GitHub स्थान`,
+ sa: `${encodedName} इत्यस्य GitHub स्थानम्`,
hu: `${encodedName} GitHub statisztika`,
it: `Statistiche GitHub di ${encodedName}`,
ja: `${encodedName} の GitHub ランク`,
@@ -65,28 +91,45 @@ const statCardLocales = ({ name, apostrophe }) => {
"pt-br": `Estatísticas do GitHub de ${encodedName}`,
np: `${encodedName}'${apostrophe} गिटहब तथ्याङ्क`,
el: `Στατιστικά GitHub του ${encodedName}`,
- ru: `Статистика GitHub пользователя ${encodedName}`,
- "uk-ua": `Статистика GitHub користувача ${encodedName}`,
+ ro: `Rankul GitHub al lui ${encodedName}`,
+ ru: `Рейтинг GitHub пользователя ${encodedName}`,
+ "uk-ua": `Рейтинг GitHub користувача ${encodedName}`,
id: `Statistik GitHub ${encodedName}`,
ml: `${encodedName}'${apostrophe} ഗിറ്റ്ഹബ് സ്ഥിതിവിവരക്കണക്കുകൾ`,
- my: `Statistik GitHub ${encodedName}`,
+ my: `${encodedName} ရဲ့ GitHub အဆင့်`,
+ ta: `${encodedName} கிட்ஹப் தரவரிசை`,
sk: `GitHub štatistiky používateľa ${encodedName}`,
tr: `${encodedName} Hesabının GitHub Yıldızları`,
pl: `Statystyki GitHub użytkownika ${encodedName}`,
uz: `${encodedName}ning GitHub'dagi statistikasi`,
vi: `Thống Kê GitHub ${encodedName}`,
se: `GitHubstatistik för ${encodedName}`,
+ he: `דרגת הגיטהאב של ${encodedName}`,
+ fil: `Ranggo ng GitHub ni ${encodedName}`,
+ th: `อันดับ GitHub ของ ${encodedName}`,
+ sr: `Ранк корисника ${encodedName}`,
+ "sr-latn": `Rank korisnika ${encodedName}`,
+ no: `GitHub-statistikk for ${encodedName}`,
},
"statcard.totalstars": {
+ en: "Total Stars Earned",
ar: "مجموع النجوم",
- cn: "获标星数(star)",
- "zh-tw": "獲標星數(star)",
+ az: "Ümumi Ulduz",
+ ca: "Total d'estrelles",
+ cn: "获标星数",
+ "zh-tw": "得標星星數量(Star)",
cs: "Celkem hvězd",
de: "Insgesamt erhaltene Sterne",
- en: "Total Stars Earned",
+ sw: "Medali(stars) ulizojishindia",
+ ur: "کل ستارے حاصل کیے",
+ bg: "Получени звезди",
bn: "সর্বমোট Star",
es: "Estrellas totales",
+ fa: "مجموع ستارههای دریافتشده",
+ fi: "Ansaitut tähdet yhteensä",
fr: "Total d'étoiles",
+ hi: "कुल अर्जित सितारे",
+ sa: "अर्जिताः कुल-तारकाः",
hu: "Csillagok",
it: "Stelle totali",
ja: "スターされた数",
@@ -96,28 +139,45 @@ const statCardLocales = ({ name, apostrophe }) => {
"pt-br": "Total de estrelas",
np: "कुल ताराहरू",
el: "Σύνολο Αστεριών",
- ru: "Всего звезд",
+ ro: "Total de stele câștigate",
+ ru: "Всего звёзд",
"uk-ua": "Всього зірок",
id: "Total Bintang",
ml: "ആകെ നക്ഷത്രങ്ങൾ",
- my: "Jumlah Bintang",
+ my: "စုစုပေါင်းကြယ်များ",
+ ta: "சம்பாதித்த மொத்த நட்சத்திரங்கள்",
sk: "Hviezdy",
tr: "Toplam Yıldız",
pl: "Liczba otrzymanych gwiazdek",
uz: "Yulduzchalar",
vi: "Tổng Số Sao",
se: "Antal intjänade stjärnor",
+ he: "סך כל הכוכבים שהושגו",
+ fil: "Kabuuang Nakuhang Bituin",
+ th: "ดาวทั้งหมดที่ได้รับ",
+ sr: "Број освојених звездица",
+ "sr-latn": "Broj osvojenih zvezdica",
+ no: "Totalt antall stjerner",
},
"statcard.commits": {
- ar: "مجموع الحفظ",
- cn: "累计提交数(commit)",
- "zh-tw": "累計提交數(commit)",
+ en: "Total Commits",
+ ar: "مجموع المساهمات",
+ az: "Ümumi Commit",
+ ca: "Commits totals",
+ cn: "累计提交总数",
+ "zh-tw": "累計提交數量(Commit)",
cs: "Celkem commitů",
de: "Anzahl Commits",
- en: "Total Commits",
+ sw: "Matendo yako yote",
+ ur: "کل کمٹ",
+ bg: "Общо ангажименти",
bn: "সর্বমোট Commit",
es: "Commits totales",
+ fa: "مجموع کامیتها",
+ fi: "Yhteensä committeja",
fr: "Total des Commits",
+ hi: "कुल commits",
+ sa: "कुल-समिन्चयः",
hu: "Összes commit",
it: "Commit totali",
ja: "合計コミット数",
@@ -127,28 +187,45 @@ const statCardLocales = ({ name, apostrophe }) => {
"pt-br": "Total de Commits",
np: "कुल Commits",
el: "Σύνολο Commits",
+ ro: "Total Commit-uri",
ru: "Всего коммитов",
"uk-ua": "Всього комітів",
id: "Total Komitmen",
ml: "ആകെ കമ്മിറ്റുകൾ",
- my: "Jumlah Komitmen",
+ my: "စုစုပေါင်း Commit များ",
+ ta: `மொத்த கமிட்கள்`,
sk: "Všetky commity",
tr: "Toplam Commit",
pl: "Wszystkie commity",
uz: "'Commit'lar",
vi: "Tổng Số Cam Kết",
se: "Totalt antal commits",
+ he: "סך כל ה־commits",
+ fil: "Kabuuang Commits",
+ th: "Commit ทั้งหมด",
+ sr: "Укупно commit-ова",
+ "sr-latn": "Ukupno commit-ova",
+ no: "Totalt antall commits",
},
"statcard.prs": {
+ en: "Total PRs",
ar: "مجموع طلبات السحب",
- cn: "拉取请求数(PR)",
- "zh-tw": "拉取請求數(PR)",
+ az: "Ümumi PR",
+ ca: "PRs totals",
+ cn: "发起的 PR 总数",
+ "zh-tw": "拉取請求數量(PR)",
cs: "Celkem PRs",
de: "PRs Insgesamt",
- en: "Total PRs",
+ sw: "PRs Zote",
+ ur: "کل پی آرز",
+ bg: "Заявки за изтегляния",
bn: "সর্বমোট PR",
es: "PRs totales",
+ fa: "مجموع Pull Request",
+ fi: "Yhteensä PR:t",
fr: "Total des PRs",
+ hi: "कुल PR",
+ sa: "कुल-पीआर",
hu: "Összes PR",
it: "PR totali",
ja: "合計 PR",
@@ -158,28 +235,45 @@ const statCardLocales = ({ name, apostrophe }) => {
"pt-br": "Total de PRs",
np: "कुल PRs",
el: "Σύνολο PRs",
- ru: "Всего pull request`ов",
- "uk-ua": "Всього pull request`iв",
+ ro: "Total PR-uri",
+ ru: "Всего запросов изменений",
+ "uk-ua": "Всього запитів на злиття",
id: "Total Permintaan Tarik",
ml: "ആകെ പുൾ അഭ്യർത്ഥനകൾ",
- my: "Jumlah PR",
+ my: "စုစုပေါင်း PR များ",
+ ta: `மொத்த இழுக்கும் கோரிக்கைகள்`,
sk: "Všetky PR",
tr: "Toplam PR",
pl: "Wszystkie PR-y",
uz: "'Pull Request'lar",
vi: "Tổng Số PR",
se: "Totalt antal PR",
+ he: "סך כל ה־PRs",
+ fil: "Kabuuang PRs",
+ th: "PR ทั้งหมด",
+ sr: "Укупно PR-ова",
+ "sr-latn": "Ukupno PR-ova",
+ no: "Totalt antall PR",
},
"statcard.issues": {
+ en: "Total Issues",
ar: "مجموع التحسينات",
- cn: "指出问题数(issue)",
- "zh-tw": "指出問題數(issue)",
+ az: "Ümumi Problem",
+ ca: "Issues totals",
+ cn: "提出的 issue 总数",
+ "zh-tw": "提出問題數量(Issue)",
cs: "Celkem problémů",
de: "Anzahl Issues",
- en: "Total Issues",
+ sw: "Masuala Ibuka",
+ ur: "کل مسائل",
+ bg: "Брой въпроси",
bn: "সর্বমোট Issue",
es: "Issues totales",
+ fa: "مجموع مسائل",
+ fi: "Yhteensä ongelmat",
fr: "Nombre total d'incidents",
+ hi: "कुल मुद्दे(Issues)",
+ sa: "कुल-समस्याः",
hu: "Összes hibajegy",
it: "Segnalazioni totali",
ja: "合計 issue",
@@ -189,28 +283,45 @@ const statCardLocales = ({ name, apostrophe }) => {
"pt-br": "Total de Issues",
np: "कुल मुद्दाहरू",
el: "Σύνολο Ζητημάτων",
- ru: "Всего issue",
- "uk-ua": "Всього issue",
+ ro: "Total Issue-uri",
+ ru: "Всего вопросов",
+ "uk-ua": "Всього питань",
id: "Total Masalah Dilaporkan",
- ml: "ആകെ ലക്കങ്ങൾ",
- my: "Jumlah Isu Dilaporkan",
+ ml: "ആകെ പ്രശ്നങ്ങൾ",
+ my: "စုစုပေါင်းပြဿနာများ",
+ ta: `மொத்த சிக்கல்கள்`,
sk: "Všetky problémy",
tr: "Toplam Hata",
pl: "Wszystkie problemy",
uz: "'Issue'lar",
vi: "Tổng Số Vấn Đề",
se: "Total antal issues",
+ he: "סך כל ה־issues",
+ fil: "Kabuuang mga Isyu",
+ th: "Issue ทั้งหมด",
+ sr: "Укупно пријављених проблема",
+ "sr-latn": "Ukupno prijavljenih problema",
+ no: "Totalt antall issues",
},
"statcard.contribs": {
+ en: "Contributed to (last year)",
ar: "ساهم في (العام الماضي)",
- cn: "贡献于(去年)",
- "zh-tw": "參與項目數 (去年)",
+ az: "Töhfə verdi (ötən il)",
+ ca: "Contribucions (l'any passat)",
+ cn: "贡献的项目数(去年)",
+ "zh-tw": "參與項目數量(去年)",
cs: "Přispěl k (minulý rok)",
de: "Beigetragen zu (letztes Jahr)",
- en: "Contributed to (last year)",
+ sw: "Idadi ya michango (mwaka mzima)",
+ ur: "پچھلے سال میں تعاون کیا",
+ bg: "Приноси (за изминалата година)",
bn: "অবদান (গত বছর)",
es: "Contribuciones en (el año pasado)",
+ fa: "مشارکت در (سال گذشته)",
+ fi: "Osallistunut (viime vuonna)",
fr: "Contribué à (l'année dernière)",
+ hi: "(पिछले वर्ष) में योगदान दिया",
+ sa: "(गते वर्षे) योगदानम् कृतम्",
hu: "Hozzájárulások (tavaly)",
it: "Ha contribuito a (l'anno scorso)",
ja: "貢献したリポジトリ (昨年)",
@@ -220,28 +331,45 @@ const statCardLocales = ({ name, apostrophe }) => {
"pt-br": "Contribuiu para (ano passado)",
np: "कुल योगदानहरू (गत वर्ष)",
el: "Συνεισφέρθηκε σε (πέρυσι)",
- ru: "Внёс вклад в (за прошлый год)",
- "uk-ua": "Зробив внесок у (за минулий рік)",
+ ro: "Total Contribuiri",
+ ru: "Внесено вклада (за прошлый год)",
+ "uk-ua": "Зроблено внесок (за минулий рік)",
id: "Berkontribusi ke (tahun lalu)",
- ml: "സമർപ്പിച്ചിരിക്കുന്നത് (കഴിഞ്ഞ വർഷം)",
- my: "Menyumbang kepada (tahun lepas)",
+ ml: "(കഴിഞ്ഞ വർഷത്തെ)ആകെ സംഭാവനകൾ ",
+ my: "အကူအညီပေးခဲ့သည် (ပြီးခဲ့သည့်နှစ်)",
+ ta: "(கடந்த ஆண்டு) பங்களித்தது",
sk: "Účasti (minulý rok)",
tr: "Katkı Verildi (geçen yıl)",
pl: "Kontrybucje (w zeszłym roku)",
uz: "Hissa qoʻshgan (o'tgan yili)",
vi: "Đã Đóng Góp (năm ngoái)",
se: "Bidragit till (förra året)",
+ he: "תרם ל... (שנה שעברה)",
+ fil: "Nag-ambag sa (nakaraang taon)",
+ th: "มีส่วนร่วมใน (ปีที่แล้ว)",
+ sr: "Доприноси (прошла година)",
+ "sr-latn": "Doprinosi (prošla godina)",
+ no: "Bidro til (i fjor)",
},
"statcard.reviews": {
- ar: "تمت مراجعة إجمالي العلاقات العامة",
- cn: "審查的 PR 總數",
- "zh-tw": "审查的 PR 总数",
+ en: "Total PRs Reviewed",
+ ar: "طلبات السحب التي تم مراجعتها",
+ az: "Nəzərdən Keçirilən Ümumi PR",
+ ca: "Total de PRs revisats",
+ cn: "审查的 PR 总数",
+ "zh-tw": "審核的 PR 總計",
cs: "Celkový počet PR",
de: "Insgesamt überprüfte PRs",
- en: "Total PRs Reviewed",
+ sw: "Idadi ya PRs zilizopitiliwa upya",
+ ur: "کل پی آرز کا جائزہ لیا",
+ bg: "Разгледани заявки за изтегляне",
bn: "সর্বমোট পুনরালোচনা করা PR",
es: "PR totales revisados",
+ fa: "مجموع درخواستهای ادغام بررسیشده",
+ fi: "Yhteensä tarkastettuja PR:itä",
fr: "Nombre total de PR examinés",
+ hi: "कुल PRs की समीक्षा की गई",
+ sa: "समीक्षिताः कुल-पीआर",
hu: "Összes ellenőrzött PR",
it: "PR totali esaminati",
ja: "レビューされた PR の総数",
@@ -251,28 +379,45 @@ const statCardLocales = ({ name, apostrophe }) => {
"pt-br": "Total de PRs revisados",
np: "कुल पीआर समीक्षित",
el: "Σύνολο Αναθεωρημένων PR",
- ru: "Всего pull request`ов проверено",
- "uk-ua": "Всього pull request`iв перевірено",
+ ro: "Total PR-uri Revizuite",
+ ru: "Всего запросов проверено",
+ "uk-ua": "Всього запитів перевірено",
id: "Total PR yang Direview",
- ml: "ആകെ പുൾ അഭിപ്രായങ്ങൾ",
- my: "Jumlah PR Dikaji Semula",
+ ml: "ആകെ പുൾ അവലോകനങ്ങൾ",
+ my: "စုစုပေါင်း PR များကို ပြန်လည်သုံးသပ်ခဲ့မှု",
+ ta: "மதிப்பாய்வு செய்யப்பட்ட மொத்த இழுத்தல் கோரிக்கைகள்",
sk: "Celkový počet PR",
tr: "İncelenen toplam PR",
pl: "Łącznie sprawdzonych PR",
uz: "Koʻrib chiqilgan PR-lar soni",
vi: "Tổng Số PR Đã Xem Xét",
se: "Totalt antal granskade PR",
+ he: "סך כל ה־PRs שנסרקו",
+ fil: "Kabuuang PR na Na-review",
+ th: "รีวิว PR แล้วทั้งหมด",
+ sr: "Укупно прегледаних PR-ова",
+ "sr-latn": "Ukupno pregledanih PR-ova",
+ no: "Totalt antall vurderte PR",
},
"statcard.discussions-started": {
- ar: "مجموع بدء المناقشات",
+ en: "Total Discussions Started",
+ ar: "مجموع المناقشات التي بدأها",
+ az: "Başladılan Ümumi Müzakirə",
+ ca: "Discussions totals iniciades",
cn: "发起的讨论总数",
"zh-tw": "發起的討論總數",
cs: "Celkem zahájených diskusí",
de: "Gesamt gestartete Diskussionen",
- en: "Total Discussions Started",
+ sw: "Idadi ya majadiliano yaliyoanzishwa",
+ ur: "کل مباحثے شروع کیے",
+ bg: "Започнати дискусии",
bn: "সর্বমোট আলোচনা শুরু",
es: "Discusiones totales iniciadas",
+ fa: "مجموع بحثهای آغازشده",
+ fi: "Aloitetut keskustelut yhteensä",
fr: "Nombre total de discussions lancées",
+ hi: "कुल चर्चाएँ शुरू हुईं",
+ sa: "प्रारब्धाः कुल-चर्चाः",
hu: "Összes megkezdett megbeszélés",
it: "Discussioni totali avviate",
ja: "開始されたディスカッションの総数",
@@ -282,28 +427,45 @@ const statCardLocales = ({ name, apostrophe }) => {
"pt-br": "Total de Discussões Iniciadas",
np: "कुल चर्चा सुरु",
el: "Σύνολο Συζητήσεων που Ξεκίνησαν",
- ru: "Всего начатых дискуссий",
+ ro: "Total Discuții Începute",
+ ru: "Всего начатых обсуждений",
"uk-ua": "Всього розпочатих дискусій",
id: "Total Diskusi Dimulai",
ml: "ആരംഭിച്ച ആലോചനകൾ",
- my: "Jumlah Perbincangan Bermula",
+ my: "စုစုပေါင်း စတင်ခဲ့သော ဆွေးနွေးမှုများ",
+ ta: "மொத்த விவாதங்கள் தொடங்கின",
sk: "Celkový počet začatých diskusií",
tr: "Başlatılan Toplam Tartışma",
pl: "Łącznie rozpoczętych dyskusji",
uz: "Boshlangan muzokaralar soni",
vi: "Tổng Số Thảo Luận Bắt Đầu",
se: "Totalt antal diskussioner startade",
+ he: "סך כל הדיונים שהותחלו",
+ fil: "Kabuuang mga Diskusyon na Sinimulan",
+ th: "เริ่มหัวข้อสนทนาทั้งหมด",
+ sr: "Укупно покренутих дискусија",
+ "sr-latn": "Ukupno pokrenutih diskusija",
+ no: "Totalt antall startede diskusjoner",
},
"statcard.discussions-answered": {
- ar: "مجموع الردود على المناقشات",
+ en: "Total Discussions Answered",
+ ar: "مجموع المناقشات المُجابة",
+ az: "Cavablandırılan Ümumi Müzakirə",
+ ca: "Discussions totals respostes",
cn: "回复的讨论总数",
- "zh-tw": "回覆的討論總數",
+ "zh-tw": "回覆討論總計",
cs: "Celkem zodpovězených diskusí",
de: "Gesamt beantwortete Diskussionen",
- en: "Total Discussions Answered",
+ sw: "Idadi ya majadiliano yaliyojibiwa",
+ ur: "کل مباحثے جواب دیے",
+ bg: "Отговорени дискусии",
bn: "সর্বমোট আলোচনা উত্তর",
es: "Discusiones totales respondidas",
+ fa: "مجموع بحثهای پاسخدادهشده",
+ fi: "Vastatut keskustelut yhteensä",
fr: "Nombre total de discussions répondues",
+ hi: "कुल चर्चाओं के उत्तर",
+ sa: "उत्तरिताः कुल-चर्चाः",
hu: "Összes megválaszolt megbeszélés",
it: "Discussioni totali risposte",
ja: "回答されたディスカッションの総数",
@@ -313,92 +475,143 @@ const statCardLocales = ({ name, apostrophe }) => {
"pt-br": "Total de Discussões Respondidas",
np: "कुल चर्चा उत्तर",
el: "Σύνολο Συζητήσεων που Απαντήθηκαν",
- ru: "Всего отвеченных дискуссий",
+ ro: "Total Răspunsuri La Discuții",
+ ru: "Всего отвеченных обсуждений",
"uk-ua": "Всього відповідей на дискусії",
id: "Total Diskusi Dibalas",
ml: "ഉത്തരം നൽകിയ ആലോചനകൾ",
- my: "Jumlah Perbincangan Dijawab",
+ my: "စုစုပေါင်း ပြန်လည်ဖြေကြားခဲ့သော ဆွေးနွေးမှုများ",
+ ta: "பதிலளிக்கப்பட்ட மொத்த விவாதங்கள்",
sk: "Celkový počet zodpovedaných diskusií",
tr: "Toplam Cevaplanan Tartışma",
pl: "Łącznie odpowiedzianych dyskusji",
uz: "Javob berilgan muzokaralar soni",
vi: "Tổng Số Thảo Luận Đã Trả Lời",
se: "Totalt antal diskussioner besvarade",
+ he: "סך כל הדיונים שנענו",
+ fil: "Kabuuang mga Diskusyon na Sinagot",
+ th: "ตอบกลับหัวข้อสนทนาทั้งหมด",
+ sr: "Укупно одговорених дискусија",
+ "sr-latn": "Ukupno odgovorenih diskusija",
+ no: "Totalt antall besvarte diskusjoner",
},
"statcard.prs-merged": {
- ar: "مجموع الطلبات المدمجة",
+ en: "Total PRs Merged",
+ ar: "مجموع طلبات السحب المُدمجة",
+ az: "Birləşdirilmiş Ümumi PR",
+ ca: "PRs totals fusionats",
cn: "合并的 PR 总数",
- "zh-tw": "合併的 PR 總數",
+ "zh-tw": "合併的 PR 總計",
cs: "Celkem sloučených PR",
de: "Insgesamt zusammengeführte PRs",
- en: "Total PRs Merged",
+ sw: "Idadi ya PRs zilizounganishwa",
+ ur: "کل پی آرز ضم کیے",
+ bg: "Сляти заявки за изтегляния",
bn: "সর্বমোট PR একত্রীকৃত",
es: "PR totales fusionados",
+ fa: "مجموع درخواستهای ادغام شده",
+ fi: "Yhteensä yhdistetyt PR:t",
fr: "Nombre total de PR fusionnés",
+ hi: "कुल PR का विलय",
+ sa: "विलीनाः कुल-पीआर",
hu: "Összes egyesített PR",
it: "PR totali uniti",
ja: "マージされた PR の総数",
kr: "병합된 총 PR",
nl: "Totaal samengevoegde PR's",
"pt-pt": "Total de PRs Fundidos",
- "pt-br": "Total de PRs Fundidos",
- np: "कुल PRs मर्ज गरिएको",
+ "pt-br": "Total de PRs Integrados",
+ np: "कुल विलयित PRs",
el: "Σύνολο Συγχωνευμένων PR",
- ru: "Всего объединённых pull request`ов",
- "uk-ua": "Всього об'єднаних pull request`iв",
+ ro: "Total PR-uri Fuzionate",
+ ru: "Всего объединённых запросов",
+ "uk-ua": "Всього об'єднаних запитів",
id: "Total PR Digabungkan",
- my: "Jumlah PR Digabungkan",
+ my: "စုစုပေါင်း ပေါင်းစည်းခဲ့သော PR များ",
+ ta: "இணைக்கப்பட்ட மொத்த PRகள்",
sk: "Celkový počet zlúčených PR",
tr: "Toplam Birleştirilmiş PR",
pl: "Łącznie połączonych PR",
uz: "Birlangan PR-lar soni",
vi: "Tổng Số PR Đã Hợp Nhất",
se: "Totalt antal sammanfogade PR",
+ he: "סך כל ה־PRs ששולבו",
+ fil: "Kabuuang mga PR na Pinagsama",
+ th: "PR ที่ถูก Merged แล้วทั้งหมด",
+ sr: "Укупно спојених PR-ова",
+ "sr-latn": "Ukupno spojenih PR-ova",
+ no: "Totalt antall sammenslåtte PR",
},
"statcard.prs-merged-percentage": {
- ar: "نسبة الطلبات المدمجة",
- cn: "合并的 PR 百分比",
+ en: "Merged PRs Percentage",
+ ar: "نسبة طلبات السحب المُدمجة",
+ az: "Birləşdirilmiş PR-ların Faizi",
+ ca: "Percentatge de PRs fusionats",
+ cn: "被合并的 PR 占比",
"zh-tw": "合併的 PR 百分比",
cs: "Sloučené PRs v procentech",
de: "Zusammengeführte PRs in Prozent",
- en: "Merged PRs Percentage",
+ sw: "Asilimia ya PRs zilizounganishwa",
+ ur: "ضم کیے گئے پی آرز کی شرح",
+ bg: "Процент сляти заявки за изтегляния",
bn: "PR একত্রীকরণের শতাংশ",
es: "Porcentaje de PR fusionados",
+ fa: "درصد درخواستهای ادغامشده",
+ fi: "Yhdistettyjen PR:ien prosentti",
fr: "Pourcentage de PR fusionnés",
+ hi: "मर्ज किए गए PRs प्रतिशत",
+ sa: "विलीन-पीआर प्रतिशतम्",
hu: "Egyesített PR-k százaléka",
it: "Percentuale di PR uniti",
ja: "マージされた PR の割合",
kr: "병합된 PR의 비율",
nl: "Percentage samengevoegde PR's",
"pt-pt": "Percentagem de PRs Fundidos",
- "pt-br": "Porcentagem de PRs Fundidos",
+ "pt-br": "Porcentagem de PRs Integrados",
np: "PR मर्ज गरिएको प्रतिशत",
el: "Ποσοστό Συγχωνευμένων PR",
- ru: "Процент объединённых pull request`ов",
- "uk-ua": "Відсоток об'єднаних pull request`iв",
+ ro: "Procentaj PR-uri Fuzionate",
+ ru: "Процент объединённых запросов",
+ "uk-ua": "Відсоток об'єднаних запитів",
id: "Persentase PR Digabungkan",
- my: "Peratus PR Digabungkan",
+ my: "PR များကို ပေါင်းစည်းခဲ့သော ရာခိုင်နှုန်း",
+ ta: "இணைக்கப்பட்ட PRகள் சதவீதம்",
sk: "Percento zlúčených PR",
tr: "Birleştirilmiş PR Yüzdesi",
pl: "Procent połączonych PR",
uz: "Birlangan PR-lar foizi",
vi: "Tỷ Lệ PR Đã Hợp Nhất",
se: "Procent av sammanfogade PR",
+ he: "אחוז ה־PRs ששולבו",
+ fil: "Porsyento ng mga PR na Pinagsama",
+ th: "เปอร์เซ็นต์ PR ที่ถูก Merged แล้วทั้งหมด",
+ sr: "Проценат спојених PR-ова",
+ "sr-latn": "Procenat spojenih PR-ova",
+ no: "Prosentandel sammenslåtte PR",
},
};
};
const repoCardLocales = {
"repocard.template": {
+ en: "Template",
ar: "قالب",
+ az: "Şablon",
+ bg: "Шаблон",
bn: "টেমপ্লেট",
+ ca: "Plantilla",
cn: "模板",
"zh-tw": "模板",
cs: "Šablona",
de: "Vorlage",
- en: "Template",
+ sw: "Kigezo",
+ ur: "سانچہ",
es: "Plantilla",
+ fa: "الگو",
+ fi: "Malli",
fr: "Modèle",
+ hi: "खाका",
+ sa: "प्रारूपम्",
hu: "Sablon",
it: "Template",
ja: "テンプレート",
@@ -408,28 +621,45 @@ const repoCardLocales = {
"pt-br": "Modelo",
np: "टेम्पलेट",
el: "Πρότυπο",
+ ro: "Șablon",
ru: "Шаблон",
"uk-ua": "Шаблон",
id: "Pola",
ml: "ടെംപ്ലേറ്റ്",
- my: "Templat",
+ my: "ပုံစံ",
+ ta: `டெம்ப்ளேட்`,
sk: "Šablóna",
tr: "Şablon",
pl: "Szablony",
uz: "Shablon",
vi: "Mẫu",
se: "Mall",
+ he: "תבנית",
+ fil: "Suleras",
+ th: "เทมเพลต",
+ sr: "Шаблон",
+ "sr-latn": "Šablon",
+ no: "Mal",
},
"repocard.archived": {
- ar: "محفوظ",
+ en: "Archived",
+ ar: "مُؤرشف",
+ az: "Arxiv",
+ bg: "Архивирани",
bn: "আর্কাইভড",
+ ca: "Arxivats",
cn: "已归档",
- "zh-tw": "已歸檔",
+ "zh-tw": "已封存",
cs: "Archivováno",
de: "Archiviert",
- en: "Archived",
+ sw: "Hifadhiwa kwenye kumbukumbu",
+ ur: "محفوظ شدہ",
es: "Archivados",
+ fa: "بایگانیشده",
+ fi: "Arkistoitu",
fr: "Archivé",
+ hi: "संग्रहीत",
+ sa: "संगृहीतम्",
hu: "Archivált",
it: "Archiviata",
ja: "アーカイブ済み",
@@ -439,96 +669,147 @@ const repoCardLocales = {
"pt-br": "Arquivados",
np: "अभिलेख राखियो",
el: "Αρχειοθετημένα",
+ ro: "Arhivat",
ru: "Архивирован",
"uk-ua": "Архивований",
id: "Arsip",
ml: "ശേഖരിച്ചത്",
- my: "Arkib",
+ my: "သိုလှောင်ပြီး",
+ ta: `காப்பகப்படுத்தப்பட்டது`,
sk: "Archivované",
tr: "Arşiv",
pl: "Zarchiwizowano",
uz: "Arxivlangan",
vi: "Đã Lưu Trữ",
se: "Arkiverade",
+ he: "גנוז",
+ fil: "Naka-arkibo",
+ th: "เก็บถาวร",
+ sr: "Архивирано",
+ "sr-latn": "Arhivirano",
+ no: "Arkivert",
},
};
const langCardLocales = {
"langcard.title": {
- ar: "أكثر اللغات إستخداماً",
+ en: "Most Used Languages",
+ ar: "أكثر اللغات استخدامًا",
+ az: "Ən Çox İstifadə Olunan Dillər",
+ ca: "Llenguatges més utilitzats",
cn: "最常用的语言",
"zh-tw": "最常用的語言",
cs: "Nejpoužívanější jazyky",
de: "Meist verwendete Sprachen",
+ bg: "Най-използвани езици",
bn: "সর্বাধিক ব্যবহৃত ভাষা সমূহ",
- en: "Most Used Languages",
+ sw: "Lugha zilizotumika zaidi",
+ ur: "سب سے زیادہ استعمال شدہ زبانیں",
es: "Lenguajes más usados",
+ fa: "زبانهای پرکاربرد",
+ fi: "Käytetyimmät kielet",
fr: "Langages les plus utilisés",
+ hi: "सर्वाधिक प्रयुक्त भाषा",
+ sa: "सर्वाधिक-प्रयुक्ताः भाषाः",
hu: "Leggyakrabban használt nyelvek",
it: "Linguaggi più utilizzati",
ja: "最もよく使っている言語",
kr: "가장 많이 사용된 언어",
nl: "Meest gebruikte talen",
- "pt-pt": "Idiomas mais usados",
+ "pt-pt": "Linguagens mais usadas",
"pt-br": "Linguagens mais usadas",
np: "अधिक प्रयोग गरिएको भाषाहरू",
el: "Οι περισσότερο χρησιμοποιούμενες γλώσσες",
- ru: "Наиболее часто используемые языки",
- "uk-ua": "Найчастіше використовувані мови",
+ ro: "Cele Mai Folosite Limbaje",
+ ru: "Наиболее используемые языки",
+ "uk-ua": "Найбільш використовувані мови",
id: "Bahasa Yang Paling Banyak Digunakan",
ml: "കൂടുതൽ ഉപയോഗിച്ച ഭാഷകൾ",
- my: "Bahasa Paling Digunakan",
+ my: "အများဆုံးအသုံးပြုသောဘာသာစကားများ",
+ ta: `அதிகம் பயன்படுத்தப்படும் மொழிகள்`,
sk: "Najviac používané jazyky",
tr: "En Çok Kullanılan Diller",
pl: "Najczęściej używane języki",
uz: "Eng koʻp ishlatiladigan tillar",
vi: "Ngôn Ngữ Thường Sử Dụng",
se: "Mest använda språken",
+ he: "השפות הכי משומשות",
+ fil: "Mga Pinakamadalas na Ginagamit na Wika",
+ th: "ภาษาที่ใช้บ่อยที่สุด",
+ sr: "Најкоришћенији језици",
+ "sr-latn": "Najkorišćeniji jezici",
+ no: "Mest brukte språk",
},
"langcard.nodata": {
- ar: "لا توجد بيانات لغات.",
- cn: "沒有語言數據。",
- "zh-tw": "沒有語言數據。",
+ en: "No languages data.",
+ ar: "لا توجد بيانات للغات.",
+ az: "Dil məlumatı yoxdur.",
+ ca: "Sense dades d'idiomes",
+ cn: "没有语言数据。",
+ "zh-tw": "沒有語言資料。",
cs: "Žádné jazykové údaje.",
de: "Keine Sprachdaten.",
+ bg: "Няма данни за езици",
bn: "কোন ভাষার ডেটা নেই।",
- en: "No languages data.",
+ sw: "Hakuna kumbukumbu ya lugha zozote",
+ ur: "کوئی زبان کا ڈیٹا نہیں۔",
es: "Sin datos de idiomas.",
+ fa: "دادهای برای زبانها وجود ندارد.",
+ fi: "Ei kielitietoja.",
fr: "Aucune donnée sur les langues.",
+ hi: "कोई भाषा डेटा नहीं",
+ sa: "भाषा-विवरणं नास्ति।",
hu: "Nincsenek nyelvi adatok.",
it: "Nessun dato sulle lingue.",
ja: "言語データがありません。",
kr: "언어 데이터가 없습니다.",
nl: "Ingen sprogdata.",
- "pt-pt": "Sem dados de idiomas.",
- "pt-br": "Sem dados de idiomas.",
+ "pt-pt": "Sem dados de linguagens.",
+ "pt-br": "Sem dados de linguagens.",
np: "कुनै भाषा डाटा छैन।",
el: "Δεν υπάρχουν δεδομένα γλωσσών.",
+ ro: "Lipsesc date despre limbă.",
ru: "Нет данных о языках.",
"uk-ua": "Немає даних про мови.",
id: "Tidak ada data bahasa.",
ml: "ഭാഷാ ഡാറ്റയില്ല.",
- my: "Tiada data bahasa.",
+ my: "ဒေတာ မရှိပါ။",
+ ta: `மொழி தரவு இல்லை.`,
sk: "Žiadne údaje o jazykoch.",
tr: "Dil verisi yok.",
pl: "Brak danych dotyczących języków.",
uz: "Til haqida ma'lumot yo'q.",
vi: "Không có dữ liệu ngôn ngữ.",
se: "Inga språkdata.",
+ he: "אין נתוני שפות",
+ fil: "Walang datos ng lenggwahe.",
+ th: "ไม่มีข้อมูลภาษา",
+ sr: "Нема података о језицима.",
+ "sr-latn": "Nema podataka o jezicima.",
+ no: "Ingen språkdata.",
},
};
const wakatimeCardLocales = {
"wakatimecard.title": {
+ en: "WakaTime Stats",
ar: "إحصائيات واكا تايم",
+ az: "WakaTime Statistikası",
+ ca: "Estadístiques de WakaTime",
cn: "WakaTime 周统计",
"zh-tw": "WakaTime 周統計",
cs: "Statistiky WakaTime",
de: "WakaTime Status",
- en: "WakaTime Stats",
+ sw: "Takwimu ya WakaTime",
+ ur: "وکاٹائم کے اعداد و شمار",
+ bg: "WakaTime статистика",
bn: "WakaTime স্ট্যাটাস",
es: "Estadísticas de WakaTime",
+ fa: "آمار WakaTime",
+ fi: "WakaTime-tilastot",
fr: "Statistiques de WakaTime",
+ hi: "वाकाटाइम आँकड़े",
+ sa: "WakaTime सांख्यिकी",
hu: "WakaTime statisztika",
it: "Statistiche WakaTime",
ja: "WakaTime ワカタイム統計",
@@ -538,28 +819,45 @@ const wakatimeCardLocales = {
"pt-br": "Estatísticas WakaTime",
np: "WakaTime तथ्या .्क",
el: "Στατιστικά WakaTime",
+ ro: "Statistici WakaTime",
ru: "Статистика WakaTime",
"uk-ua": "Статистика WakaTime",
id: "Status WakaTime",
- ml: "വേക്ക് ടൈം സ്ഥിതിവിവരക്കണക്കുകൾ",
- my: "Statistik WakaTime",
+ ml: "വാകടൈം സ്ഥിതിവിവരക്കണക്കുകൾ",
+ my: "WakaTime အချက်အလက်များ",
+ ta: `WakaTime புள்ளிவிவரங்கள்`,
sk: "WakaTime štatistika",
tr: "WakaTime İstatistikler",
pl: "Statystyki WakaTime",
uz: "WakaTime statistikasi",
vi: "Thống Kê WakaTime",
se: "WakaTime statistik",
+ he: "סטטיסטיקות WakaTime",
+ fil: "Mga Estadistika ng WakaTime",
+ th: "สถิติ WakaTime",
+ sr: "WakaTime статистика",
+ "sr-latn": "WakaTime statistika",
+ no: "WakaTime-statistikk",
},
"wakatimecard.lastyear": {
+ en: "last year",
ar: "العام الماضي",
+ az: "Ötən il",
+ ca: "L'any passat",
cn: "去年",
"zh-tw": "去年",
cs: "Minulý rok",
de: "Letztes Jahr",
- en: "last year",
+ sw: "Mwaka uliopita",
+ ur: "پچھلا سال",
+ bg: "миналата год.",
bn: "গত বছর",
es: "El año pasado",
+ fa: "سال گذشته",
+ fi: "Viime vuosi",
fr: "L'année dernière",
+ hi: "पिछले साल",
+ sa: "गतवर्षे",
hu: "Tavaly",
it: "L'anno scorso",
ja: "昨年",
@@ -569,28 +867,45 @@ const wakatimeCardLocales = {
"pt-br": "Ano passado",
np: "गत वर्ष",
el: "Πέρυσι",
+ ro: "Anul trecut",
ru: "За прошлый год",
"uk-ua": "За минулий рік",
id: "Tahun lalu",
ml: "കഴിഞ്ഞ വർഷം",
- my: "Tahun lepas",
+ my: "မနှစ်က",
+ ta: `கடந்த ஆண்டு`,
sk: "Minulý rok",
tr: "Geçen yıl",
pl: "W zeszłym roku",
uz: "O'tgan yil",
vi: "Năm ngoái",
se: "Förra året",
+ he: "שנה שעברה",
+ fil: "Nakaraang Taon",
+ th: "ปีที่แล้ว",
+ sr: "Прошла год.",
+ "sr-latn": "Prošla god.",
+ no: "I fjor",
},
"wakatimecard.last7days": {
+ en: "last 7 days",
ar: "آخر 7 أيام",
+ az: "Son 7 gün",
+ ca: "Ultims 7 dies",
cn: "最近 7 天",
"zh-tw": "最近 7 天",
cs: "Posledních 7 dní",
de: "Letzte 7 Tage",
- en: "last 7 days",
+ sw: "Siku 7 zilizopita",
+ ur: "پچھلے 7 دن",
+ bg: "последните 7 дни",
bn: "গত ৭ দিন",
es: "Últimos 7 días",
+ fa: "هفت روز گذشته",
+ fi: "Viimeiset 7 päivää",
fr: "7 derniers jours",
+ hi: "पिछले 7 दिन",
+ sa: "विगतसप्तदिनेषु",
hu: "Elmúlt 7 nap",
it: "Ultimi 7 giorni",
ja: "過去 7 日間",
@@ -600,59 +915,93 @@ const wakatimeCardLocales = {
"pt-br": "Últimos 7 dias",
np: "गत ७ दिन",
el: "Τελευταίες 7 ημέρες",
+ ro: "Ultimele 7 zile",
ru: "Последние 7 дней",
"uk-ua": "Останні 7 днів",
id: "7 hari terakhir",
ml: "കഴിഞ്ഞ 7 ദിവസം",
- my: "7 hari lepas",
+ my: "7 ရက်အတွင်း",
+ ta: `கடந்த 7 நாட்கள்`,
sk: "Posledných 7 dní",
tr: "Son 7 gün",
pl: "Ostatnie 7 dni",
uz: "O'tgan 7 kun",
vi: "7 ngày qua",
se: "Senaste 7 dagarna",
+ he: "ב־7 הימים האחרונים",
+ fil: "Huling 7 Araw",
+ th: "7 วันที่ผ่านมา",
+ sr: "Претходних 7 дана",
+ "sr-latn": "Prethodnih 7 dana",
+ no: "Siste 7 dager",
},
"wakatimecard.notpublic": {
- ar: "ملف المستخدم غير عام",
+ en: "WakaTime user profile not public",
+ ar: "ملف مستخدم واكا تايم شخصي",
+ az: "WakaTime istifadəçi profili ictimai deyil",
+ ca: "Perfil d'usuari de WakaTime no públic",
cn: "WakaTime 用户个人资料未公开",
"zh-tw": "WakaTime 使用者個人資料未公開",
cs: "Profil uživatele WakaTime není veřejný",
de: "WakaTime-Benutzerprofil nicht öffentlich",
- en: "WakaTime user profile not public",
+ sw: "Maelezo ya mtumizi wa WakaTime si ya watu wote(umma)",
+ ur: "وکاٹائم صارف کا پروفائل عوامی نہیں",
+ bg: "Потребителски профил в WakaTime не е общодостъпен",
bn: "WakaTime ব্যবহারকারীর প্রোফাইল প্রকাশ্য নয়",
es: "Perfil de usuario de WakaTime no público",
+ fa: "پروفایل کاربری WakaTime عمومی نیست",
+ fi: "WakaTime-käyttäjäprofiili ei ole julkinen",
fr: "Profil utilisateur WakaTime non public",
+ hi: "WakaTime उपयोगकर्ता प्रोफ़ाइल सार्वजनिक नहीं है",
+ sa: "WakaTime उपयोगकर्ता-प्रोफ़ाइल सार्वजनिकं नास्ति",
hu: "A WakaTime felhasználói profilja nem nyilvános",
it: "Profilo utente WakaTime non pubblico",
ja: "WakaTime ユーザープロファイルは公開されていません",
kr: "WakaTime 사용자 프로필이 공개되지 않았습니다",
nl: "WakaTime gebruikersprofiel niet openbaar",
- "pt-pt": "Perfil de usuário WakaTime não público",
+ "pt-pt": "Perfil de utilizador WakaTime não público",
"pt-br": "Perfil de usuário WakaTime não público",
np: "WakaTime प्रयोगकर्ता प्रोफाइल सार्वजनिक छैन",
el: "Το προφίλ χρήστη WakaTime δεν είναι δημόσιο",
- ru: "Профиль пользователя WakaTime не является общедоступным",
- "uk-ua": "Профіль користувача WakaTime не є публічним",
+ ro: "Profilul utilizatorului de Wakatime nu este public",
+ ru: "Профиль пользователя WakaTime не общедоступный",
+ "uk-ua": "Профіль користувача WakaTime не публічний",
id: "Profil pengguna WakaTime tidak publik",
ml: "WakaTime ഉപയോക്തൃ പ്രൊഫൈൽ പൊതുവായി പ്രസിദ്ധീകരിക്കപ്പെടാത്തതാണ്",
- my: "Profil pengguna WakaTime tidak awam",
+ my: "Public Profile မဟုတ်ပါ။",
+ ta: `WakaTime பயனர் சுயவிவரம் பொதுவில் இல்லை.`,
sk: "Profil používateľa WakaTime nie je verejný",
tr: "WakaTime kullanıcı profili herkese açık değil",
pl: "Profil użytkownika WakaTime nie jest publiczny",
uz: "WakaTime foydalanuvchi profili ochiq emas",
vi: "Hồ sơ người dùng WakaTime không công khai",
se: "WakaTime användarprofil inte offentlig",
+ he: "פרופיל משתמש WakaTime לא פומבי",
+ fil: "Hindi pampubliko ang profile ng gumagamit ng WakaTime",
+ th: "โปรไฟล์ผู้ใช้ WakaTime ไม่ได้เป็นสาธารณะ",
+ sr: "WakaTime профил корисника није јаван",
+ "sr-latn": "WakaTime profil korisnika nije javan",
+ no: "WakaTime brukerprofil ikke offentlig",
},
"wakatimecard.nocodedetails": {
- ar: "المستخدم لا يشارك معلومات تفصيلية عن البرمجة",
+ en: "User doesn't publicly share detailed code statistics",
+ ar: "المستخدم لا يشارك المعلومات التفصيلية",
+ az: "İstifadəçi kod statistikalarını ictimai şəkildə paylaşmır",
+ ca: "L'usuari no comparteix dades públiques del seu codi",
cn: "用户不公开分享详细的代码统计信息",
"zh-tw": "使用者不公開分享詳細的程式碼統計資訊",
cs: "Uživatel nesdílí podrobné statistiky kódu",
de: "Benutzer teilt keine detaillierten Code-Statistiken",
- en: "User doesn't publicly share detailed code statistics",
+ sw: "Mtumizi hagawi kila kitu au takwimu na umma",
+ ur: "صارف عوامی طور پر تفصیلی کوڈ کے اعداد و شمار شیئر نہیں کرتا",
+ bg: "Потребителят не споделя подробна статистика за код",
bn: "ব্যবহারকারী বিস্তারিত কোড পরিসংখ্যান প্রকাশ করেন না",
es: "El usuario no comparte públicamente estadísticas detalladas de código",
+ fa: "کاربر آمار کد تفصیلی را بهصورت عمومی به اشتراک نمیگذارد",
+ fi: "Käyttäjä ei jaa julkisesti tarkkoja kooditilastoja",
fr: "L'utilisateur ne partage pas publiquement de statistiques de code détaillées",
+ hi: "उपयोगकर्ता विस्तृत कोड आँकड़े सार्वजनिक रूप से साझा नहीं करता है",
+ sa: "उपयोगकर्ता विस्तृत-कोड-सांख्यिकीं सार्वजनिकरूपेण न दर्शयति",
hu: "A felhasználó nem osztja meg nyilvánosan a részletes kódstatisztikákat",
it: "L'utente non condivide pubblicamente statistiche dettagliate sul codice",
ja: "ユーザーは詳細なコード統計を公開しません",
@@ -664,28 +1013,45 @@ const wakatimeCardLocales = {
"O usuário não compartilha publicamente estatísticas detalhadas de código",
np: "प्रयोगकर्ता सार्वजनिक रूपमा विस्तृत कोड तथ्याङ्क साझा गर्दैन",
el: "Ο χρήστης δεν δημοσιεύει δημόσια λεπτομερείς στατιστικές κώδικα",
+ ro: "Utilizatorul nu își publică statisticile detaliate ale codului",
ru: "Пользователь не делится подробной статистикой кода",
"uk-ua": "Користувач не публікує детальну статистику коду",
id: "Pengguna tidak membagikan statistik kode terperinci secara publik",
- ml: "ഉപയോക്താവ് പൊതുവെ വിശദീകരിച്ച കോഡ് സ്റ്റാറ്റിസ്റ്റിക്സ് പങ്കിടുന്നില്ല",
- my: "Pengguna tidak berkongsi statistik kod terperinci secara awam",
+ ml: "ഉപയോക്താവ് പൊതുവായി വിശദീകരിച്ച കോഡ് സ്റ്റാറ്റിസ്റ്റിക്സ് പങ്കിടുന്നില്ല",
+ my: "အသုံးပြုသူသည် အသေးစိတ် ကုဒ် စာရင်းအင်းများကို အများသို့ မမျှဝေပါ။",
+ ta: `பயனர் விரிவான குறியீட்டு புள்ளிவிவரங்களைப் பொதுவில் பகிர்வதில்லை.`,
sk: "Používateľ neposkytuje verejne podrobné štatistiky kódu",
tr: "Kullanıcı ayrıntılı kod istatistiklerini herkese açık olarak paylaşmıyor",
pl: "Użytkownik nie udostępnia publicznie szczegółowych statystyk kodu",
uz: "Foydalanuvchi umumiy ko`d statistikasini ochiq ravishda almashmaydi",
vi: "Người dùng không chia sẻ thống kê mã chi tiết công khai",
se: "Användaren delar inte offentligt detaljerad kodstatistik",
+ he: "משתמש לא מפרסם פומבית סטטיסטיקות קוד מפורטות",
+ fil: "Hindi ibinabahagi ng gumagamit ang detalyadong estadistika ng code nang pampubliko",
+ th: "ผู้ใช้ไม่ได้แชร์สถิติโค้ดแบบสาธารณะ",
+ sr: "Корисник не дели јавно детаљну статистику кода",
+ "sr-latn": "Korisnik ne deli javno detaljnu statistiku koda",
+ no: "Brukeren deler ikke detaljert kodestatistikk offentlig",
},
"wakatimecard.nocodingactivity": {
+ en: "No coding activity this week",
ar: "لا يوجد نشاط برمجي لهذا الأسبوع",
+ az: "Bu həftə heç bir kodlaşdırma fəaliyyəti olmayıb",
+ ca: "No hi ha activitat de codificació aquesta setmana",
cn: "本周没有编程活动",
"zh-tw": "本周沒有編程活動",
cs: "Tento týden žádná aktivita v kódování",
de: "Keine Aktivitäten in dieser Woche",
- en: "No coding activity this week",
+ sw: "Hakuna matukio yoyote ya kusimba wiki hii",
+ ur: "اس ہفتے کوئی کوڈنگ سرگرمی نہیں",
+ bg: "Няма активност при кодирането тази седмица",
bn: "এই সপ্তাহে কোন কোডিং অ্যাক্টিভিটি নেই",
es: "No hay actividad de codificación esta semana",
+ fa: "فعالیت کدنویسی در این هفته وجود ندارد",
+ fi: "Ei koodaustoimintaa tällä viikolla",
fr: "Aucune activité de codage cette semaine",
+ hi: "इस सप्ताह कोई कोडिंग गतिविधि नहीं ",
+ sa: "अस्मिन् सप्ताहे कोडिङ्-कार्यं नास्ति",
hu: "Nem volt aktivitás ezen a héten",
it: "Nessuna attività in questa settimana",
ja: "今週のコーディング活動はありません",
@@ -695,17 +1061,25 @@ const wakatimeCardLocales = {
"pt-br": "Nenhuma atividade de codificação esta semana",
np: "यस हप्ता कुनै कोडिंग गतिविधि छैन",
el: "Δεν υπάρχει δραστηριότητα κώδικα γι' αυτή την εβδομάδα",
+ ro: "Nicio activitate de programare săptămâna aceasta",
ru: "На этой неделе не было активности",
- "uk-ua": "На цьому тижні не було активності",
+ "uk-ua": "Цього тижня не було активності",
id: "Tidak ada aktivitas perkodingan minggu ini",
ml: "ഈ ആഴ്ച കോഡിംഗ് പ്രവർത്തനങ്ങളൊന്നുമില്ല",
- my: "Tiada aktiviti pengekodan minggu ini",
+ my: "ဒီအပတ်မှာ ကုဒ်ရေးခြင်း မရှိပါ။",
+ ta: `இந்த வாரம் குறியீட்டு செயல்பாடு இல்லை.`,
sk: "Žiadna kódovacia aktivita tento týždeň",
tr: "Bu hafta herhangi bir kod yazma aktivitesi olmadı",
pl: "Brak aktywności w tym tygodniu",
uz: "Bu hafta faol bo'lmadi",
vi: "Không Có Hoạt Động Trong Tuần Này",
se: "Ingen aktivitet denna vecka",
+ he: "אין פעילות תכנותית השבוע",
+ fil: "Walang aktibidad sa pag-code ngayong linggo",
+ th: "ไม่มีกิจกรรมการเขียนโค้ดในสัปดาห์นี้",
+ sr: "Током ове недеље није било никаквих активности",
+ "sr-latn": "Tokom ove nedelje nije bilo nikakvih aktivnosti",
+ no: "Ingen kodeaktivitet denne uken",
},
};
diff --git a/tests/__snapshots__/renderWakatimeCard.test.js.snap b/tests/__snapshots__/renderWakatimeCard.test.js.snap
index f38ac26ef07f7..8b423afbb5951 100644
--- a/tests/__snapshots__/renderWakatimeCard.test.js.snap
+++ b/tests/__snapshots__/renderWakatimeCard.test.js.snap
@@ -1,6 +1,162 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
-exports[`Test Render WakaTime Card should render correctly 1`] = `[Function]`;
+exports[`Test Render WakaTime Card should render correctly 1`] = `
+"
+
+
+
+
+
+
+
+
+
+
+
+
+ WakaTime Stats (last 7 days)
+
+
+
+
+
+
+
+
+
+ Other:
+ 19 mins
+
+
+
+
+
+
+
+
+
+
+
+ TypeScript:
+ 1 min
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ "
+`;
exports[`Test Render WakaTime Card should render correctly with compact layout 1`] = `
"
@@ -305,3 +461,161 @@ exports[`Test Render WakaTime Card should render correctly with compact layout w
"
`;
+
+exports[`Test Render WakaTime Card should render correctly with percent display format 1`] = `
+"
+
+
+
+
+
+
+
+
+
+
+
+
+ WakaTime Stats (last 7 days)
+
+
+
+
+
+
+
+
+
+ Other:
+ 47.39 %
+
+
+
+
+
+
+
+
+
+
+
+ TypeScript:
+ 50.48 %
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ "
+`;
diff --git a/tests/api.test.js b/tests/api.test.js
index c155220ce5372..a9cc12afc149c 100644
--- a/tests/api.test.js
+++ b/tests/api.test.js
@@ -1,12 +1,24 @@
-import { jest } from "@jest/globals";
+// @ts-check
+
+import {
+ afterEach,
+ beforeEach,
+ describe,
+ expect,
+ it,
+ jest,
+} from "@jest/globals";
import axios from "axios";
import MockAdapter from "axios-mock-adapter";
import api from "../api/index.js";
import { calculateRank } from "../src/calculateRank.js";
-import { renderStatsCard } from "../src/cards/stats-card.js";
-import { CONSTANTS, renderError } from "../src/common/utils.js";
-import { expect, it, describe, afterEach } from "@jest/globals";
+import { renderStatsCard } from "../src/cards/stats.js";
+import { renderError } from "../src/common/render.js";
+import { CACHE_TTL, DURATIONS } from "../src/common/cache.js";
+/**
+ * @type {import("../src/fetchers/stats").StatsData}
+ */
const stats = {
name: "Anurag Hazra",
totalStars: 100,
@@ -19,7 +31,7 @@ const stats = {
totalDiscussionsStarted: 10,
totalDiscussionsAnswered: 40,
contributedTo: 50,
- rank: null,
+ rank: { level: "DEV", percentile: 0 },
};
stats.rank = calculateRank({
@@ -38,8 +50,10 @@ const data_stats = {
user: {
name: stats.name,
repositoriesContributedTo: { totalCount: stats.contributedTo },
- contributionsCollection: {
+ commits: {
totalCommitContributions: stats.totalCommits,
+ },
+ reviews: {
totalPullRequestReviewContributions: stats.totalReviews,
},
pullRequests: { totalCount: stats.totalPRs },
@@ -76,6 +90,7 @@ const error = {
const mock = new MockAdapter(axios);
+// @ts-ignore
const faker = (query, data) => {
const req = {
query: {
@@ -92,6 +107,10 @@ const faker = (query, data) => {
return { req, res };
};
+beforeEach(() => {
+ process.env.CACHE_SECONDS = undefined;
+});
+
afterEach(() => {
mock.reset();
});
@@ -102,8 +121,10 @@ describe("Test /api/", () => {
await api(req, res);
- expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
- expect(res.send).toBeCalledWith(renderStatsCard(stats, { ...req.query }));
+ expect(res.setHeader).toHaveBeenCalledWith("Content-Type", "image/svg+xml");
+ expect(res.send).toHaveBeenCalledWith(
+ renderStatsCard(stats, { ...req.query }),
+ );
});
it("should render error card on error", async () => {
@@ -111,12 +132,13 @@ describe("Test /api/", () => {
await api(req, res);
- expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
- expect(res.send).toBeCalledWith(
- renderError(
- error.errors[0].message,
- "Make sure the provided username is not an organization",
- ),
+ expect(res.setHeader).toHaveBeenCalledWith("Content-Type", "image/svg+xml");
+ expect(res.send).toHaveBeenCalledWith(
+ renderError({
+ message: error.errors[0].message,
+ secondaryMessage:
+ "Make sure the provided username is not an organization",
+ }),
);
});
@@ -125,13 +147,14 @@ describe("Test /api/", () => {
await api(req, res);
- expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
- expect(res.send).toBeCalledWith(
- renderError(
- error.errors[0].message,
- "Make sure the provided username is not an organization",
- { theme: "merko" },
- ),
+ expect(res.setHeader).toHaveBeenCalledWith("Content-Type", "image/svg+xml");
+ expect(res.send).toHaveBeenCalledWith(
+ renderError({
+ message: error.errors[0].message,
+ secondaryMessage:
+ "Make sure the provided username is not an organization",
+ renderOptions: { theme: "merko" },
+ }),
);
});
@@ -153,8 +176,8 @@ describe("Test /api/", () => {
await api(req, res);
- expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
- expect(res.send).toBeCalledWith(
+ expect(res.setHeader).toHaveBeenCalledWith("Content-Type", "image/svg+xml");
+ expect(res.send).toHaveBeenCalledWith(
renderStatsCard(stats, {
hide: ["issues", "prs", "contribs"],
show_icons: true,
@@ -168,6 +191,38 @@ describe("Test /api/", () => {
);
});
+ it("should have proper cache", async () => {
+ const { req, res } = faker({}, data_stats);
+
+ await api(req, res);
+
+ expect(res.setHeader.mock.calls).toEqual([
+ ["Content-Type", "image/svg+xml"],
+ [
+ "Cache-Control",
+ `max-age=${CACHE_TTL.STATS_CARD.DEFAULT}, ` +
+ `s-maxage=${CACHE_TTL.STATS_CARD.DEFAULT}, ` +
+ `stale-while-revalidate=${DURATIONS.ONE_DAY}`,
+ ],
+ ]);
+ });
+
+ it("should set proper cache", async () => {
+ const cache_seconds = DURATIONS.TWELVE_HOURS;
+ const { req, res } = faker({ cache_seconds }, data_stats);
+ await api(req, res);
+
+ expect(res.setHeader.mock.calls).toEqual([
+ ["Content-Type", "image/svg+xml"],
+ [
+ "Cache-Control",
+ `max-age=${cache_seconds}, ` +
+ `s-maxage=${cache_seconds}, ` +
+ `stale-while-revalidate=${DURATIONS.ONE_DAY}`,
+ ],
+ ]);
+ });
+
it("should set shorter cache when error", async () => {
const { req, res } = faker({}, error);
await api(req, res);
@@ -176,13 +231,96 @@ describe("Test /api/", () => {
["Content-Type", "image/svg+xml"],
[
"Cache-Control",
- `max-age=${CONSTANTS.ERROR_CACHE_SECONDS / 2}, s-maxage=${
- CONSTANTS.ERROR_CACHE_SECONDS
- }, stale-while-revalidate=${CONSTANTS.ONE_DAY}`,
+ `max-age=${CACHE_TTL.ERROR}, ` +
+ `s-maxage=${CACHE_TTL.ERROR}, ` +
+ `stale-while-revalidate=${DURATIONS.ONE_DAY}`,
],
]);
});
+ it("should properly set cache using CACHE_SECONDS env variable", async () => {
+ const cacheSeconds = "10000";
+ process.env.CACHE_SECONDS = cacheSeconds;
+
+ const { req, res } = faker({}, data_stats);
+ await api(req, res);
+
+ expect(res.setHeader.mock.calls).toEqual([
+ ["Content-Type", "image/svg+xml"],
+ [
+ "Cache-Control",
+ `max-age=${cacheSeconds}, ` +
+ `s-maxage=${cacheSeconds}, ` +
+ `stale-while-revalidate=${DURATIONS.ONE_DAY}`,
+ ],
+ ]);
+ });
+
+ it("should disable cache when CACHE_SECONDS is set to 0", async () => {
+ process.env.CACHE_SECONDS = "0";
+
+ const { req, res } = faker({}, data_stats);
+ await api(req, res);
+
+ expect(res.setHeader.mock.calls).toEqual([
+ ["Content-Type", "image/svg+xml"],
+ [
+ "Cache-Control",
+ "no-cache, no-store, must-revalidate, max-age=0, s-maxage=0",
+ ],
+ ["Pragma", "no-cache"],
+ ["Expires", "0"],
+ ]);
+ });
+
+ it("should set proper cache with clamped values", async () => {
+ {
+ let { req, res } = faker({ cache_seconds: 200_000 }, data_stats);
+ await api(req, res);
+
+ expect(res.setHeader.mock.calls).toEqual([
+ ["Content-Type", "image/svg+xml"],
+ [
+ "Cache-Control",
+ `max-age=${CACHE_TTL.STATS_CARD.MAX}, ` +
+ `s-maxage=${CACHE_TTL.STATS_CARD.MAX}, ` +
+ `stale-while-revalidate=${DURATIONS.ONE_DAY}`,
+ ],
+ ]);
+ }
+
+ // note i'm using block scoped vars
+ {
+ let { req, res } = faker({ cache_seconds: 0 }, data_stats);
+ await api(req, res);
+
+ expect(res.setHeader.mock.calls).toEqual([
+ ["Content-Type", "image/svg+xml"],
+ [
+ "Cache-Control",
+ `max-age=${CACHE_TTL.STATS_CARD.MIN}, ` +
+ `s-maxage=${CACHE_TTL.STATS_CARD.MIN}, ` +
+ `stale-while-revalidate=${DURATIONS.ONE_DAY}`,
+ ],
+ ]);
+ }
+
+ {
+ let { req, res } = faker({ cache_seconds: -10_000 }, data_stats);
+ await api(req, res);
+
+ expect(res.setHeader.mock.calls).toEqual([
+ ["Content-Type", "image/svg+xml"],
+ [
+ "Cache-Control",
+ `max-age=${CACHE_TTL.STATS_CARD.MIN}, ` +
+ `s-maxage=${CACHE_TTL.STATS_CARD.MIN}, ` +
+ `stale-while-revalidate=${DURATIONS.ONE_DAY}`,
+ ],
+ ]);
+ }
+ });
+
it("should allow changing ring_color", async () => {
const { req, res } = faker(
{
@@ -202,8 +340,8 @@ describe("Test /api/", () => {
await api(req, res);
- expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
- expect(res.send).toBeCalledWith(
+ expect(res.setHeader).toHaveBeenCalledWith("Content-Type", "image/svg+xml");
+ expect(res.send).toHaveBeenCalledWith(
renderStatsCard(stats, {
hide: ["issues", "prs", "contribs"],
show_icons: true,
@@ -223,9 +361,13 @@ describe("Test /api/", () => {
await api(req, res);
- expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
- expect(res.send).toBeCalledWith(
- renderError("Something went wrong", "This username is blacklisted"),
+ expect(res.setHeader).toHaveBeenCalledWith("Content-Type", "image/svg+xml");
+ expect(res.send).toHaveBeenCalledWith(
+ renderError({
+ message: "This username is blacklisted",
+ secondaryMessage: "Please deploy your own instance",
+ renderOptions: { show_repo_link: false },
+ }),
);
});
@@ -234,9 +376,12 @@ describe("Test /api/", () => {
await api(req, res);
- expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
- expect(res.send).toBeCalledWith(
- renderError("Something went wrong", "Language not found"),
+ expect(res.setHeader).toHaveBeenCalledWith("Content-Type", "image/svg+xml");
+ expect(res.send).toHaveBeenCalledWith(
+ renderError({
+ message: "Something went wrong",
+ secondaryMessage: "Language not found",
+ }),
);
});
@@ -252,9 +397,12 @@ describe("Test /api/", () => {
await api(req, res);
- expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
- expect(res.send).toBeCalledWith(
- renderError("Could not fetch total commits.", "Please try again later"),
+ expect(res.setHeader).toHaveBeenCalledWith("Content-Type", "image/svg+xml");
+ expect(res.send).toHaveBeenCalledWith(
+ renderError({
+ message: "Could not fetch total commits.",
+ secondaryMessage: "Please try again later",
+ }),
);
// Received SVG output should not contain string "https://tiny.one/readme-stats"
expect(res.send.mock.calls[0][0]).not.toContain(
diff --git a/tests/bench/api.bench.js b/tests/bench/api.bench.js
index 4796b64306e24..d6581da3f9752 100644
--- a/tests/bench/api.bench.js
+++ b/tests/bench/api.bench.js
@@ -1,8 +1,8 @@
-import { benchmarkSuite } from "jest-bench";
import api from "../../api/index.js";
import axios from "axios";
import MockAdapter from "axios-mock-adapter";
-import { jest } from "@jest/globals";
+import { it, jest } from "@jest/globals";
+import { runAndLogStats } from "./utils.js";
const stats = {
name: "Anurag Hazra",
@@ -24,8 +24,10 @@ const data_stats = {
user: {
name: stats.name,
repositoriesContributedTo: { totalCount: stats.contributedTo },
- contributionsCollection: {
+ commits: {
totalCommitContributions: stats.totalCommits,
+ },
+ reviews: {
totalPullRequestReviewContributions: stats.totalReviews,
},
pullRequests: { totalCount: stats.totalPRs },
@@ -67,10 +69,10 @@ const faker = (query, data) => {
return { req, res };
};
-benchmarkSuite("test /api", {
- ["simple request"]: async () => {
+it("test /api", async () => {
+ await runAndLogStats("test /api", async () => {
const { req, res } = faker({}, data_stats);
await api(req, res);
- },
+ });
});
diff --git a/tests/bench/calculateRank.bench.js b/tests/bench/calculateRank.bench.js
index 1ce6b05b28291..6907dd21af290 100644
--- a/tests/bench/calculateRank.bench.js
+++ b/tests/bench/calculateRank.bench.js
@@ -1,8 +1,9 @@
-import { benchmarkSuite } from "jest-bench";
import { calculateRank } from "../../src/calculateRank.js";
+import { it } from "@jest/globals";
+import { runAndLogStats } from "./utils.js";
-benchmarkSuite("calculateRank", {
- ["calculateRank"]: () => {
+it("calculateRank", async () => {
+ await runAndLogStats("calculateRank", () => {
calculateRank({
all_commits: false,
commits: 1300,
@@ -13,5 +14,5 @@ benchmarkSuite("calculateRank", {
stars: 600000,
followers: 50000,
});
- },
+ });
});
diff --git a/tests/bench/gist.bench.js b/tests/bench/gist.bench.js
index 69f381379c20b..66e618ec810ec 100644
--- a/tests/bench/gist.bench.js
+++ b/tests/bench/gist.bench.js
@@ -1,8 +1,8 @@
-import { benchmarkSuite } from "jest-bench";
import gist from "../../api/gist.js";
import axios from "axios";
import MockAdapter from "axios-mock-adapter";
-import { jest } from "@jest/globals";
+import { it, jest } from "@jest/globals";
+import { runAndLogStats } from "./utils.js";
const gist_data = {
data: {
@@ -34,8 +34,8 @@ const gist_data = {
const mock = new MockAdapter(axios);
mock.onPost("https://api.github.com/graphql").reply(200, gist_data);
-benchmarkSuite("test /api/gist", {
- ["simple request"]: async () => {
+it("test /api/gist", async () => {
+ await runAndLogStats("test /api/gist", async () => {
const req = {
query: {
id: "bbfce31e0217a3689c8d961a356cb10d",
@@ -47,5 +47,5 @@ benchmarkSuite("test /api/gist", {
};
await gist(req, res);
- },
+ });
});
diff --git a/tests/bench/pin.bench.js b/tests/bench/pin.bench.js
index 636e0d58bdd79..9a2498460dfa2 100644
--- a/tests/bench/pin.bench.js
+++ b/tests/bench/pin.bench.js
@@ -1,8 +1,8 @@
-import { benchmarkSuite } from "jest-bench";
import pin from "../../api/pin.js";
import axios from "axios";
import MockAdapter from "axios-mock-adapter";
-import { jest } from "@jest/globals";
+import { it, jest } from "@jest/globals";
+import { runAndLogStats } from "./utils.js";
const data_repo = {
repository: {
@@ -32,8 +32,8 @@ const data_user = {
const mock = new MockAdapter(axios);
mock.onPost("https://api.github.com/graphql").reply(200, data_user);
-benchmarkSuite("test /api/pin", {
- ["simple request"]: async () => {
+it("test /api/pin", async () => {
+ await runAndLogStats("test /api/pin", async () => {
const req = {
query: {
username: "anuraghazra",
@@ -46,5 +46,5 @@ benchmarkSuite("test /api/pin", {
};
await pin(req, res);
- },
+ });
});
diff --git a/tests/bench/utils.js b/tests/bench/utils.js
new file mode 100644
index 0000000000000..e135302599ac0
--- /dev/null
+++ b/tests/bench/utils.js
@@ -0,0 +1,133 @@
+// @ts-check
+
+const DEFAULT_RUNS = 1000;
+const DEFAULT_WARMUPS = 50;
+
+/**
+ * Formats a duration in nanoseconds to a compact human-readable string.
+ *
+ * @param {bigint} ns Duration in nanoseconds.
+ * @returns {string} Formatted time string.
+ */
+const formatTime = (ns) => {
+ if (ns < 1_000n) {
+ return `${ns}ns`;
+ }
+ if (ns < 1_000_000n) {
+ return `${Number(ns) / 1_000}µs`;
+ }
+ if (ns < 1_000_000_000n) {
+ return `${(Number(ns) / 1_000_000).toFixed(3)}ms`;
+ }
+ return `${(Number(ns) / 1_000_000_000).toFixed(3)}s`;
+};
+
+/**
+ * Measures synchronous or async function execution time.
+ *
+ * @param {Function} fn Function to measure.
+ * @returns {Promise} elapsed nanoseconds
+ */
+const measurePerformance = async (fn) => {
+ const start = process.hrtime.bigint();
+ const ret = fn();
+ if (ret instanceof Promise) {
+ await ret;
+ }
+ const end = process.hrtime.bigint();
+ return end - start;
+};
+
+/**
+ * Computes basic & extended statistics.
+ *
+ * @param {bigint[]} samples Array of samples in nanoseconds.
+ * @returns {object} Stats
+ */
+const computeStats = (samples) => {
+ const sorted = [...samples].sort((a, b) => (a < b ? -1 : 1));
+ const toNumber = (b) => Number(b); // safe for typical short benches
+ const n = sorted.length;
+ const sum = sorted.reduce((a, b) => a + b, 0n);
+ const avg = Number(sum) / n;
+ const median =
+ n % 2
+ ? toNumber(sorted[(n - 1) / 2])
+ : (toNumber(sorted[n / 2 - 1]) + toNumber(sorted[n / 2])) / 2;
+ const p = (q) => {
+ const idx = Math.min(n - 1, Math.floor((q / 100) * n));
+ return toNumber(sorted[idx]);
+ };
+ const min = toNumber(sorted[0]);
+ const max = toNumber(sorted[n - 1]);
+ const variance =
+ sorted.reduce((acc, v) => acc + (toNumber(v) - avg) ** 2, 0) / n;
+ const stdev = Math.sqrt(variance);
+
+ return {
+ runs: n,
+ min,
+ max,
+ average: avg,
+ median,
+ p75: p(75),
+ p95: p(95),
+ p99: p(99),
+ stdev,
+ totalTime: toNumber(sum),
+ };
+};
+
+/**
+ * Benchmark a function.
+ *
+ * @param {string} fnName Name of the function (for logging).
+ * @param {Function} fn Function to benchmark.
+ * @param {object} [opts] Options.
+ * @param {number} [opts.runs] Number of measured runs.
+ * @param {number} [opts.warmup] Warm-up iterations (not measured).
+ * @param {boolean} [opts.trimOutliers] Drop top & bottom 1% before stats.
+ * @returns {Promise