From 7aa50eee6cfe0e6348dba58a511a8dc55ca19755 Mon Sep 17 00:00:00 2001 From: Ku6epXBOCTuK Date: Fri, 28 Aug 2026 14:55:57 +0500 Subject: [PATCH] docs: update refs html extract script --- refs-html/background-remover.html | 16 +++++++++++++++- refs-html/demo.html | 16 +++++++++++++++- refs-html/gradient.html | 16 +++++++++++++++- refs-html/index.html | 16 +++++++++++++++- refs-html/list-tools.html | 16 +++++++++++++++- scripts/extract-static.mjs | 26 ++++++++++++++++++++++++++ 6 files changed, 101 insertions(+), 5 deletions(-) diff --git a/refs-html/background-remover.html b/refs-html/background-remover.html index 3c578aa..8b3675c 100644 --- a/refs-html/background-remover.html +++ b/refs-html/background-remover.html @@ -2232,5 +2232,19 @@ h1 { - + + + + \ No newline at end of file diff --git a/refs-html/demo.html b/refs-html/demo.html index 64c5d3e..80072d2 100644 --- a/refs-html/demo.html +++ b/refs-html/demo.html @@ -2590,5 +2590,19 @@ h1 { - + + + + \ No newline at end of file diff --git a/refs-html/gradient.html b/refs-html/gradient.html index 1ff30c0..b647f3c 100644 --- a/refs-html/gradient.html +++ b/refs-html/gradient.html @@ -2227,5 +2227,19 @@ opacity: 1; - + + + + \ No newline at end of file diff --git a/refs-html/index.html b/refs-html/index.html index 28aa2d4..37d55ae 100644 --- a/refs-html/index.html +++ b/refs-html/index.html @@ -2590,5 +2590,19 @@ h1 { - + + + + \ No newline at end of file diff --git a/refs-html/list-tools.html b/refs-html/list-tools.html index d8ba64a..1646614 100644 --- a/refs-html/list-tools.html +++ b/refs-html/list-tools.html @@ -2954,5 +2954,19 @@ h1 { - + + + + \ No newline at end of file diff --git a/scripts/extract-static.mjs b/scripts/extract-static.mjs index b22c638..aab5faa 100644 --- a/scripts/extract-static.mjs +++ b/scripts/extract-static.mjs @@ -7,6 +7,31 @@ import { join, dirname, basename } from 'node:path'; const root = process.argv[2]; const dest = process.argv[3]; +// --- inject a minimal theme toggle (extraction strips all +`; + +function injectThemeToggle(html) { + if (html.includes('__themeToggleInjected')) return html; + const tag = ''; + if (html.includes(tag)) return html.replace(tag, THEME_TOGGLE + '\n' + tag); + if (html.includes('')) return html.replace('', THEME_TOGGLE + '\n'); + return html + '\n' + THEME_TOGGLE; +} + // --- CSS: find the compiled chunk and pretty-print it --- const cssChunks = join(root, '..', '..', 'static', 'chunks'); const cssFile = readdirSync(cssChunks) @@ -110,6 +135,7 @@ for (const [src, out] of pages) { ); html = fmtHtml(html); + html = injectThemeToggle(html); const file = join(dest, out); mkdirSync(dirname(file), { recursive: true });