move default card_width for wakatime card, add to readme

This commit is contained in:
martin-mfg
2025-09-14 13:38:16 +02:00
parent f928ec429d
commit b7a4823f91
2 changed files with 8 additions and 3 deletions
+1
View File
@@ -623,6 +623,7 @@ You can customize the appearance and behavior of the WakaTime stats card using t
| --- | --- | --- | --- |
| `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` |
+7 -3
View File
@@ -223,10 +223,10 @@ const getStyles = ({
*/
const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
let { languages = [] } = stats;
const {
let {
hide_title = false,
hide_border = false,
card_width = 495,
card_width,
hide,
line_height = 25,
title_color,
@@ -245,6 +245,10 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
disable_animations,
} = options;
if (isNaN(card_width)) {
card_width = 495;
}
const shouldHideLangs = Array.isArray(hide) && hide.length > 0;
if (shouldHideLangs) {
const languagesToHide = new Set(hide.map((lang) => lowercaseTrim(lang)));
@@ -335,7 +339,7 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
y: 25,
langs: filteredLanguages,
display_format,
card_width: card_width,
card_width,
}).join("")
: noCodingActivityNode({
// @ts-ignore