diff --git a/.gitignore b/.gitignore index ee6497d5..6240da8b 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,3 @@ pnpm-debug.log* # macOS-specific files .DS_Store - -# Generated by process-gitbook script -src/assets/gitbook/ diff --git a/README.md b/README.md index 6724f505..ff5f5760 100644 --- a/README.md +++ b/README.md @@ -49,15 +49,14 @@ npm run linkcheck-local - `src/content/docs/docs/` — primary markdown content organized by topic (e.g., `users/`, `developers/`). - `public/docs/` — static assets (images, PDFs) served as-is. - `src/assets/` — project assets referenced by the site. -- `scripts/process-gitbook.js` — parses `SUMMARY.md`, transforms GitBook-style content, and updates sidebar topics in `astro.config.mjs`. - `scripts/linkcheck.js` — simple crawler to check links when the site is running locally. - `astro.config.mjs` — Astro/Starlight configuration and custom head scripts. Tips: - Add or update docs under `src/content/docs/docs/…`. -- When adding a new page, update **both** `astro.config.mjs` (sidebar items array) **and** `src/content/docs/docs/SUMMARY.md` (table of contents). The sidebar config controls navigation on the live site, and `SUMMARY.md` is parsed by `process-gitbook.js` during the build. +- When adding a new page, update `astro.config.mjs` (sidebar items array) to include it in the navigation. - Place large assets in `public/docs/...` and reference via site-relative paths. -- Run `npm run dev` to auto-process and preview changes. +- Run `npm run dev` to preview changes. ### Issue labels (suggested) diff --git a/package-lock.json b/package-lock.json index a6c23568..03004561 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,8 +12,6 @@ "@astrojs/starlight": "^0.37.4", "@lunariajs/starlight": "^0.1.1", "astro": "^5.6.1", - "gray-matter": "^4.0.3", - "js-yaml": "^4.1.0", "katex": "^0.16.22", "rehype-katex": "^7.0.1", "remark-math": "^6.0.0", @@ -3295,6 +3293,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, "license": "BSD-2-Clause", "bin": { "esparse": "bin/esparse.js", @@ -3439,18 +3438,6 @@ "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "license": "MIT" }, - "node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", - "license": "MIT", - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/extract-zip": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", @@ -3745,43 +3732,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/gray-matter": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/gray-matter/-/gray-matter-4.0.3.tgz", - "integrity": "sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==", - "license": "MIT", - "dependencies": { - "js-yaml": "^3.13.1", - "kind-of": "^6.0.2", - "section-matter": "^1.0.0", - "strip-bom-string": "^1.0.0" - }, - "engines": { - "node": ">=6.0" - } - }, - "node_modules/gray-matter/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "license": "MIT", - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/gray-matter/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "license": "MIT", - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/h3": { "version": "1.15.1", "resolved": "https://registry.npmjs.org/h3/-/h3-1.15.1.tgz", @@ -4498,15 +4448,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -4660,15 +4601,6 @@ "katex": "cli.js" } }, - "node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/kleur": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", @@ -7058,19 +6990,6 @@ "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==", "license": "ISC" }, - "node_modules/section-matter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz", - "integrity": "sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==", - "license": "MIT", - "dependencies": { - "extend-shallow": "^2.0.1", - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/semver": { "version": "7.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", @@ -7274,12 +7193,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "license": "BSD-3-Clause" - }, "node_modules/starlight-image-zoom": { "version": "0.13.2", "resolved": "https://registry.npmjs.org/starlight-image-zoom/-/starlight-image-zoom-0.13.2.tgz", @@ -7379,15 +7292,6 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/strip-bom-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", - "integrity": "sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/style-to-js": { "version": "1.1.21", "resolved": "https://registry.npmjs.org/style-to-js/-/style-to-js-1.1.21.tgz", diff --git a/package.json b/package.json index e6b1d11d..7d3541ed 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,11 @@ "type": "module", "version": "0.0.1", "scripts": { - "dev": "npm run process-gitbook && astro dev", - "start": "npm run process-gitbook && astro dev", - "build": "npm run process-gitbook && astro build && npx lunaria build && node scripts/postbuild-copy-sitemaps.js", + "dev": "astro dev", + "start": "astro dev", + "build": "astro build && npx lunaria build && node scripts/postbuild-copy-sitemaps.js", "preview": "astro preview", "astro": "astro", - "process-gitbook": "node scripts/process-gitbook.js", "lint-fix": "npx prettier . --write", "linkcheck-local": "node scripts/linkcheck.js http://localhost:4321/docs" }, @@ -17,9 +16,7 @@ "@astrojs/starlight": "^0.37.4", "@lunariajs/starlight": "^0.1.1", "astro": "^5.6.1", - "gray-matter": "^4.0.3", - "js-yaml": "^4.1.0", - "katex": "^0.16.22", +"katex": "^0.16.22", "rehype-katex": "^7.0.1", "remark-math": "^6.0.0", "sharp": "^0.33.5", diff --git a/public/docs/gitbook/BTC Backed Stables info (1).png b/public/docs/gitbook/BTC Backed Stables info (1).png deleted file mode 100644 index 71d523fd..00000000 Binary files a/public/docs/gitbook/BTC Backed Stables info (1).png and /dev/null differ diff --git a/public/docs/gitbook/BTC Backed Stables info (2).png b/public/docs/gitbook/BTC Backed Stables info (2).png deleted file mode 100644 index 3300f76a..00000000 Binary files a/public/docs/gitbook/BTC Backed Stables info (2).png and /dev/null differ diff --git a/public/docs/gitbook/BTC Backed Stables info (3).png b/public/docs/gitbook/BTC Backed Stables info (3).png deleted file mode 100644 index f29c9574..00000000 Binary files a/public/docs/gitbook/BTC Backed Stables info (3).png and /dev/null differ diff --git a/public/docs/gitbook/BTC Backed Stables info (4).png b/public/docs/gitbook/BTC Backed Stables info (4).png deleted file mode 100644 index 9af31837..00000000 Binary files a/public/docs/gitbook/BTC Backed Stables info (4).png and /dev/null differ diff --git a/public/docs/gitbook/BTC Backed Stables info.png b/public/docs/gitbook/BTC Backed Stables info.png deleted file mode 100644 index 71d523fd..00000000 Binary files a/public/docs/gitbook/BTC Backed Stables info.png and /dev/null differ diff --git a/public/docs/gitbook/BTC Boost Stable.png b/public/docs/gitbook/BTC Boost Stable.png deleted file mode 100644 index a19b6f3d..00000000 Binary files a/public/docs/gitbook/BTC Boost Stable.png and /dev/null differ diff --git a/public/docs/gitbook/BTC Flow.png b/public/docs/gitbook/BTC Flow.png deleted file mode 100644 index 3e8eb021..00000000 Binary files a/public/docs/gitbook/BTC Flow.png and /dev/null differ diff --git a/public/docs/gitbook/Blog_Banner.png b/public/docs/gitbook/Blog_Banner.png deleted file mode 100644 index 436bfb36..00000000 Binary files a/public/docs/gitbook/Blog_Banner.png and /dev/null differ diff --git a/public/docs/gitbook/CCPA_Privacy_Notice_for_California_Residents_Mezo_4871-8170-8231_v.1.docx.pdf b/public/docs/gitbook/CCPA_Privacy_Notice_for_California_Residents_Mezo_4871-8170-8231_v.1.docx.pdf deleted file mode 100644 index 2af21e24..00000000 Binary files a/public/docs/gitbook/CCPA_Privacy_Notice_for_California_Residents_Mezo_4871-8170-8231_v.1.docx.pdf and /dev/null differ diff --git a/public/docs/gitbook/Deposit Flow - Success.png b/public/docs/gitbook/Deposit Flow - Success.png deleted file mode 100644 index 7b705426..00000000 Binary files a/public/docs/gitbook/Deposit Flow - Success.png and /dev/null differ diff --git a/public/docs/gitbook/Diagram - Curve to Mezo.png b/public/docs/gitbook/Diagram - Curve to Mezo.png deleted file mode 100644 index 7e2dc351..00000000 Binary files a/public/docs/gitbook/Diagram - Curve to Mezo.png and /dev/null differ diff --git a/public/docs/gitbook/Ethereum Connect.png b/public/docs/gitbook/Ethereum Connect.png deleted file mode 100644 index b5354569..00000000 Binary files a/public/docs/gitbook/Ethereum Connect.png and /dev/null differ diff --git a/public/docs/gitbook/First deposit screen (1).png b/public/docs/gitbook/First deposit screen (1).png deleted file mode 100644 index 5e06c125..00000000 Binary files a/public/docs/gitbook/First deposit screen (1).png and /dev/null differ diff --git a/public/docs/gitbook/First deposit screen .png b/public/docs/gitbook/First deposit screen .png deleted file mode 100644 index 5e06c125..00000000 Binary files a/public/docs/gitbook/First deposit screen .png and /dev/null differ diff --git a/public/docs/gitbook/Full logo banner (1).png b/public/docs/gitbook/Full logo banner (1).png deleted file mode 100644 index c5083fab..00000000 Binary files a/public/docs/gitbook/Full logo banner (1).png and /dev/null differ diff --git a/public/docs/gitbook/Full logo banner.png b/public/docs/gitbook/Full logo banner.png deleted file mode 100644 index c5083fab..00000000 Binary files a/public/docs/gitbook/Full logo banner.png and /dev/null differ diff --git a/public/docs/gitbook/Invite_graphic-1.png b/public/docs/gitbook/Invite_graphic-1.png deleted file mode 100644 index bb16a987..00000000 Binary files a/public/docs/gitbook/Invite_graphic-1.png and /dev/null differ diff --git a/public/docs/gitbook/Invite_graphic.png b/public/docs/gitbook/Invite_graphic.png deleted file mode 100644 index 8c6a71b1..00000000 Binary files a/public/docs/gitbook/Invite_graphic.png and /dev/null differ diff --git a/public/docs/gitbook/Launch Roadmap.png b/public/docs/gitbook/Launch Roadmap.png deleted file mode 100644 index 71d7317a..00000000 Binary files a/public/docs/gitbook/Launch Roadmap.png and /dev/null differ diff --git a/public/docs/gitbook/LinearDecayChart.png b/public/docs/gitbook/LinearDecayChart.png deleted file mode 100644 index 87ad4f97..00000000 Binary files a/public/docs/gitbook/LinearDecayChart.png and /dev/null differ diff --git a/public/docs/gitbook/LinearDecayHeader.png b/public/docs/gitbook/LinearDecayHeader.png deleted file mode 100644 index 81c26c6e..00000000 Binary files a/public/docs/gitbook/LinearDecayHeader.png and /dev/null differ diff --git a/public/docs/gitbook/Log in with Bitcoin Audit - Thesis Defense.pdf b/public/docs/gitbook/Log in with Bitcoin Audit - Thesis Defense.pdf deleted file mode 100644 index 2ea3ef6a..00000000 Binary files a/public/docs/gitbook/Log in with Bitcoin Audit - Thesis Defense.pdf and /dev/null differ diff --git a/public/docs/gitbook/Mezo Overview.png b/public/docs/gitbook/Mezo Overview.png deleted file mode 100644 index 6e02f8c7..00000000 Binary files a/public/docs/gitbook/Mezo Overview.png and /dev/null differ diff --git a/public/docs/gitbook/Mezo Portal Audit - Thesis Defense.pdf b/public/docs/gitbook/Mezo Portal Audit - Thesis Defense.pdf deleted file mode 100644 index fa7b4938..00000000 Binary files a/public/docs/gitbook/Mezo Portal Audit - Thesis Defense.pdf and /dev/null differ diff --git a/public/docs/gitbook/Mezo everything banner bold.png b/public/docs/gitbook/Mezo everything banner bold.png deleted file mode 100644 index c5b29069..00000000 Binary files a/public/docs/gitbook/Mezo everything banner bold.png and /dev/null differ diff --git a/public/docs/gitbook/Mezo-1c-Offred-Profile.png b/public/docs/gitbook/Mezo-1c-Offred-Profile.png deleted file mode 100644 index da0e0a8e..00000000 Binary files a/public/docs/gitbook/Mezo-1c-Offred-Profile.png and /dev/null differ diff --git a/public/docs/gitbook/Mint-Multiple deposits.png b/public/docs/gitbook/Mint-Multiple deposits.png deleted file mode 100644 index d1bcec17..00000000 Binary files a/public/docs/gitbook/Mint-Multiple deposits.png and /dev/null differ diff --git a/public/docs/gitbook/New assets.png b/public/docs/gitbook/New assets.png deleted file mode 100644 index ba6634e0..00000000 Binary files a/public/docs/gitbook/New assets.png and /dev/null differ diff --git a/public/docs/gitbook/Points Page (1).png b/public/docs/gitbook/Points Page (1).png deleted file mode 100644 index 6292cd71..00000000 Binary files a/public/docs/gitbook/Points Page (1).png and /dev/null differ diff --git a/public/docs/gitbook/Points Page.png b/public/docs/gitbook/Points Page.png deleted file mode 100644 index 6292cd71..00000000 Binary files a/public/docs/gitbook/Points Page.png and /dev/null differ diff --git a/public/docs/gitbook/Portal code entered.webp b/public/docs/gitbook/Portal code entered.webp deleted file mode 100644 index 125bba39..00000000 Binary files a/public/docs/gitbook/Portal code entered.webp and /dev/null differ diff --git a/public/docs/gitbook/Quantstamp Mezo Portal Audit.pdf b/public/docs/gitbook/Quantstamp Mezo Portal Audit.pdf deleted file mode 100644 index 0f926c9a..00000000 Binary files a/public/docs/gitbook/Quantstamp Mezo Portal Audit.pdf and /dev/null differ diff --git a/public/docs/gitbook/River_Delta_-_Privacy_Policy_4858-2859-8706_v.3_1.docx.pdf b/public/docs/gitbook/River_Delta_-_Privacy_Policy_4858-2859-8706_v.3_1.docx.pdf deleted file mode 100644 index 65d63597..00000000 Binary files a/public/docs/gitbook/River_Delta_-_Privacy_Policy_4858-2859-8706_v.3_1.docx.pdf and /dev/null differ diff --git a/public/docs/gitbook/Screen Shot 2024-04-05 at 12.25.53 AM.png b/public/docs/gitbook/Screen Shot 2024-04-05 at 12.25.53 AM.png deleted file mode 100644 index 9fb3a731..00000000 Binary files a/public/docs/gitbook/Screen Shot 2024-04-05 at 12.25.53 AM.png and /dev/null differ diff --git a/public/docs/gitbook/Screen Shot 2024-04-05 at 12.31.46 AM.png b/public/docs/gitbook/Screen Shot 2024-04-05 at 12.31.46 AM.png deleted file mode 100644 index c4b0d450..00000000 Binary files a/public/docs/gitbook/Screen Shot 2024-04-05 at 12.31.46 AM.png and /dev/null differ diff --git a/public/docs/gitbook/Screen Shot 2024-04-05 at 12.32.18 AM.png b/public/docs/gitbook/Screen Shot 2024-04-05 at 12.32.18 AM.png deleted file mode 100644 index 849a3359..00000000 Binary files a/public/docs/gitbook/Screen Shot 2024-04-05 at 12.32.18 AM.png and /dev/null differ diff --git a/public/docs/gitbook/Screen Shot 2024-04-08 at 4.41.30 PM.png b/public/docs/gitbook/Screen Shot 2024-04-08 at 4.41.30 PM.png deleted file mode 100644 index ee73d7fd..00000000 Binary files a/public/docs/gitbook/Screen Shot 2024-04-08 at 4.41.30 PM.png and /dev/null differ diff --git a/public/docs/gitbook/Screen Shot 2024-04-08 at 4.42.44 PM.png b/public/docs/gitbook/Screen Shot 2024-04-08 at 4.42.44 PM.png deleted file mode 100644 index a4360b86..00000000 Binary files a/public/docs/gitbook/Screen Shot 2024-04-08 at 4.42.44 PM.png and /dev/null differ diff --git a/public/docs/gitbook/Screen Shot 2024-04-08 at 4.42.50 PM.png b/public/docs/gitbook/Screen Shot 2024-04-08 at 4.42.50 PM.png deleted file mode 100644 index a6901f35..00000000 Binary files a/public/docs/gitbook/Screen Shot 2024-04-08 at 4.42.50 PM.png and /dev/null differ diff --git a/public/docs/gitbook/Screen Shot 2024-04-08 at 4.43.33 PM.png b/public/docs/gitbook/Screen Shot 2024-04-08 at 4.43.33 PM.png deleted file mode 100644 index 50849cf7..00000000 Binary files a/public/docs/gitbook/Screen Shot 2024-04-08 at 4.43.33 PM.png and /dev/null differ diff --git a/public/docs/gitbook/Screen Shot 2024-04-08 at 4.43.40 PM.png b/public/docs/gitbook/Screen Shot 2024-04-08 at 4.43.40 PM.png deleted file mode 100644 index 0b15a654..00000000 Binary files a/public/docs/gitbook/Screen Shot 2024-04-08 at 4.43.40 PM.png and /dev/null differ diff --git a/public/docs/gitbook/Screen Shot 2024-04-08 at 4.43.46 PM.png b/public/docs/gitbook/Screen Shot 2024-04-08 at 4.43.46 PM.png deleted file mode 100644 index 542bf229..00000000 Binary files a/public/docs/gitbook/Screen Shot 2024-04-08 at 4.43.46 PM.png and /dev/null differ diff --git a/public/docs/gitbook/Screen Shot 2024-04-08 at 4.44.03 PM.png b/public/docs/gitbook/Screen Shot 2024-04-08 at 4.44.03 PM.png deleted file mode 100644 index 423d68c7..00000000 Binary files a/public/docs/gitbook/Screen Shot 2024-04-08 at 4.44.03 PM.png and /dev/null differ diff --git a/public/docs/gitbook/Screen Shot 2024-04-08 at 4.45.51 PM.png b/public/docs/gitbook/Screen Shot 2024-04-08 at 4.45.51 PM.png deleted file mode 100644 index 6e097b4c..00000000 Binary files a/public/docs/gitbook/Screen Shot 2024-04-08 at 4.45.51 PM.png and /dev/null differ diff --git a/public/docs/gitbook/Screen Shot 2024-04-08 at 5.13.35 PM (1).png b/public/docs/gitbook/Screen Shot 2024-04-08 at 5.13.35 PM (1).png deleted file mode 100644 index d6d1370f..00000000 Binary files a/public/docs/gitbook/Screen Shot 2024-04-08 at 5.13.35 PM (1).png and /dev/null differ diff --git a/public/docs/gitbook/Screen Shot 2024-04-08 at 5.13.35 PM.png b/public/docs/gitbook/Screen Shot 2024-04-08 at 5.13.35 PM.png deleted file mode 100644 index 88466084..00000000 Binary files a/public/docs/gitbook/Screen Shot 2024-04-08 at 5.13.35 PM.png and /dev/null differ diff --git a/public/docs/gitbook/Screen Shot 2024-04-08 at 7.51.26 PM.png b/public/docs/gitbook/Screen Shot 2024-04-08 at 7.51.26 PM.png deleted file mode 100644 index 212efc45..00000000 Binary files a/public/docs/gitbook/Screen Shot 2024-04-08 at 7.51.26 PM.png and /dev/null differ diff --git a/public/docs/gitbook/Screen Shot 2024-04-08 at 7.54.00 PM.png b/public/docs/gitbook/Screen Shot 2024-04-08 at 7.54.00 PM.png deleted file mode 100644 index 049d036c..00000000 Binary files a/public/docs/gitbook/Screen Shot 2024-04-08 at 7.54.00 PM.png and /dev/null differ diff --git a/public/docs/gitbook/Screen Shot 2024-04-08 at 8.03.24 PM (1).png b/public/docs/gitbook/Screen Shot 2024-04-08 at 8.03.24 PM (1).png deleted file mode 100644 index 460a362f..00000000 Binary files a/public/docs/gitbook/Screen Shot 2024-04-08 at 8.03.24 PM (1).png and /dev/null differ diff --git a/public/docs/gitbook/Screen Shot 2024-04-08 at 8.03.24 PM.png b/public/docs/gitbook/Screen Shot 2024-04-08 at 8.03.24 PM.png deleted file mode 100644 index 460a362f..00000000 Binary files a/public/docs/gitbook/Screen Shot 2024-04-08 at 8.03.24 PM.png and /dev/null differ diff --git a/public/docs/gitbook/Screen Shot 2024-04-09 at 10.34.17 AM.png b/public/docs/gitbook/Screen Shot 2024-04-09 at 10.34.17 AM.png deleted file mode 100644 index 85ffdea1..00000000 Binary files a/public/docs/gitbook/Screen Shot 2024-04-09 at 10.34.17 AM.png and /dev/null differ diff --git a/public/docs/gitbook/Screen Shot 2024-04-09 at 10.34.24 AM (1).png b/public/docs/gitbook/Screen Shot 2024-04-09 at 10.34.24 AM (1).png deleted file mode 100644 index 1a430672..00000000 Binary files a/public/docs/gitbook/Screen Shot 2024-04-09 at 10.34.24 AM (1).png and /dev/null differ diff --git a/public/docs/gitbook/Screen Shot 2024-04-09 at 10.34.24 AM.png b/public/docs/gitbook/Screen Shot 2024-04-09 at 10.34.24 AM.png deleted file mode 100644 index 1a430672..00000000 Binary files a/public/docs/gitbook/Screen Shot 2024-04-09 at 10.34.24 AM.png and /dev/null differ diff --git a/public/docs/gitbook/Screen Shot 2024-04-09 at 11.39.19 AM.png b/public/docs/gitbook/Screen Shot 2024-04-09 at 11.39.19 AM.png deleted file mode 100644 index 5dd82c7d..00000000 Binary files a/public/docs/gitbook/Screen Shot 2024-04-09 at 11.39.19 AM.png and /dev/null differ diff --git a/public/docs/gitbook/Screen Shot 2024-04-15 at 4.29.24 PM.png b/public/docs/gitbook/Screen Shot 2024-04-15 at 4.29.24 PM.png deleted file mode 100644 index 05c8b5a3..00000000 Binary files a/public/docs/gitbook/Screen Shot 2024-04-15 at 4.29.24 PM.png and /dev/null differ diff --git a/public/docs/gitbook/Screenshot 2024-04-09 at 11.07.35 AM (1).png b/public/docs/gitbook/Screenshot 2024-04-09 at 11.07.35 AM (1).png deleted file mode 100644 index 8835c9c9..00000000 Binary files a/public/docs/gitbook/Screenshot 2024-04-09 at 11.07.35 AM (1).png and /dev/null differ diff --git a/public/docs/gitbook/Screenshot 2024-04-09 at 11.07.35 AM (2).png b/public/docs/gitbook/Screenshot 2024-04-09 at 11.07.35 AM (2).png deleted file mode 100644 index 8835c9c9..00000000 Binary files a/public/docs/gitbook/Screenshot 2024-04-09 at 11.07.35 AM (2).png and /dev/null differ diff --git a/public/docs/gitbook/Screenshot 2024-04-09 at 11.07.35 AM.png b/public/docs/gitbook/Screenshot 2024-04-09 at 11.07.35 AM.png deleted file mode 100644 index 8835c9c9..00000000 Binary files a/public/docs/gitbook/Screenshot 2024-04-09 at 11.07.35 AM.png and /dev/null differ diff --git a/public/docs/gitbook/Screenshot 2024-04-09 at 11.07.42 AM (1).png b/public/docs/gitbook/Screenshot 2024-04-09 at 11.07.42 AM (1).png deleted file mode 100644 index 086f02f3..00000000 Binary files a/public/docs/gitbook/Screenshot 2024-04-09 at 11.07.42 AM (1).png and /dev/null differ diff --git a/public/docs/gitbook/Screenshot 2024-04-09 at 11.07.42 AM (2).png b/public/docs/gitbook/Screenshot 2024-04-09 at 11.07.42 AM (2).png deleted file mode 100644 index 086f02f3..00000000 Binary files a/public/docs/gitbook/Screenshot 2024-04-09 at 11.07.42 AM (2).png and /dev/null differ diff --git a/public/docs/gitbook/Screenshot 2024-04-09 at 11.07.42 AM.png b/public/docs/gitbook/Screenshot 2024-04-09 at 11.07.42 AM.png deleted file mode 100644 index 086f02f3..00000000 Binary files a/public/docs/gitbook/Screenshot 2024-04-09 at 11.07.42 AM.png and /dev/null differ diff --git a/public/docs/gitbook/Screenshot 2024-04-09 at 11.08.10 AM (1).png b/public/docs/gitbook/Screenshot 2024-04-09 at 11.08.10 AM (1).png deleted file mode 100644 index 1acebb8f..00000000 Binary files a/public/docs/gitbook/Screenshot 2024-04-09 at 11.08.10 AM (1).png and /dev/null differ diff --git a/public/docs/gitbook/Screenshot 2024-04-09 at 11.08.10 AM (2).png b/public/docs/gitbook/Screenshot 2024-04-09 at 11.08.10 AM (2).png deleted file mode 100644 index 1acebb8f..00000000 Binary files a/public/docs/gitbook/Screenshot 2024-04-09 at 11.08.10 AM (2).png and /dev/null differ diff --git a/public/docs/gitbook/Screenshot 2024-04-09 at 11.08.10 AM.png b/public/docs/gitbook/Screenshot 2024-04-09 at 11.08.10 AM.png deleted file mode 100644 index 1acebb8f..00000000 Binary files a/public/docs/gitbook/Screenshot 2024-04-09 at 11.08.10 AM.png and /dev/null differ diff --git a/public/docs/gitbook/Screenshot 2024-04-09 at 11.08.54 AM (1).png b/public/docs/gitbook/Screenshot 2024-04-09 at 11.08.54 AM (1).png deleted file mode 100644 index 96e8996a..00000000 Binary files a/public/docs/gitbook/Screenshot 2024-04-09 at 11.08.54 AM (1).png and /dev/null differ diff --git a/public/docs/gitbook/Screenshot 2024-04-09 at 11.08.54 AM (2).png b/public/docs/gitbook/Screenshot 2024-04-09 at 11.08.54 AM (2).png deleted file mode 100644 index 96e8996a..00000000 Binary files a/public/docs/gitbook/Screenshot 2024-04-09 at 11.08.54 AM (2).png and /dev/null differ diff --git a/public/docs/gitbook/Screenshot 2024-04-09 at 11.08.54 AM.png b/public/docs/gitbook/Screenshot 2024-04-09 at 11.08.54 AM.png deleted file mode 100644 index 96e8996a..00000000 Binary files a/public/docs/gitbook/Screenshot 2024-04-09 at 11.08.54 AM.png and /dev/null differ diff --git a/public/docs/gitbook/Screenshot 2024-04-09 at 11.21.12 AM.png b/public/docs/gitbook/Screenshot 2024-04-09 at 11.21.12 AM.png deleted file mode 100644 index 6487959d..00000000 Binary files a/public/docs/gitbook/Screenshot 2024-04-09 at 11.21.12 AM.png and /dev/null differ diff --git "a/public/docs/gitbook/Screenshot 2024-05-29 at 1.40.28\342\200\257PM.png" "b/public/docs/gitbook/Screenshot 2024-05-29 at 1.40.28\342\200\257PM.png" deleted file mode 100644 index eb70c025..00000000 Binary files "a/public/docs/gitbook/Screenshot 2024-05-29 at 1.40.28\342\200\257PM.png" and /dev/null differ diff --git "a/public/docs/gitbook/Screenshot 2024-05-29 at 1.40.51\342\200\257PM.png" "b/public/docs/gitbook/Screenshot 2024-05-29 at 1.40.51\342\200\257PM.png" deleted file mode 100644 index 564bb625..00000000 Binary files "a/public/docs/gitbook/Screenshot 2024-05-29 at 1.40.51\342\200\257PM.png" and /dev/null differ diff --git "a/public/docs/gitbook/Screenshot 2024-06-03 at 8.35.47\342\200\257AM (1).png" "b/public/docs/gitbook/Screenshot 2024-06-03 at 8.35.47\342\200\257AM (1).png" deleted file mode 100644 index cffe60c9..00000000 Binary files "a/public/docs/gitbook/Screenshot 2024-06-03 at 8.35.47\342\200\257AM (1).png" and /dev/null differ diff --git "a/public/docs/gitbook/Screenshot 2024-06-03 at 8.35.47\342\200\257AM.png" "b/public/docs/gitbook/Screenshot 2024-06-03 at 8.35.47\342\200\257AM.png" deleted file mode 100644 index cffe60c9..00000000 Binary files "a/public/docs/gitbook/Screenshot 2024-06-03 at 8.35.47\342\200\257AM.png" and /dev/null differ diff --git a/public/docs/gitbook/Screenshot 2025-01-15 at 3.50.46 PM.png b/public/docs/gitbook/Screenshot 2025-01-15 at 3.50.46 PM.png deleted file mode 100644 index 25e1fd1b..00000000 Binary files a/public/docs/gitbook/Screenshot 2025-01-15 at 3.50.46 PM.png and /dev/null differ diff --git a/public/docs/gitbook/Screenshot from 2024-11-19 01-02-14.png b/public/docs/gitbook/Screenshot from 2024-11-19 01-02-14.png deleted file mode 100644 index 0bb48898..00000000 Binary files a/public/docs/gitbook/Screenshot from 2024-11-19 01-02-14.png and /dev/null differ diff --git a/public/docs/gitbook/Screenshot from 2024-11-19 01-20-40.png b/public/docs/gitbook/Screenshot from 2024-11-19 01-20-40.png deleted file mode 100644 index cd0b3bd3..00000000 Binary files a/public/docs/gitbook/Screenshot from 2024-11-19 01-20-40.png and /dev/null differ diff --git a/public/docs/gitbook/Screenshot from 2024-11-19 01-37-06.png b/public/docs/gitbook/Screenshot from 2024-11-19 01-37-06.png deleted file mode 100644 index a73a0e92..00000000 Binary files a/public/docs/gitbook/Screenshot from 2024-11-19 01-37-06.png and /dev/null differ diff --git a/public/docs/gitbook/Screenshot from 2024-11-19 02-34-25.png b/public/docs/gitbook/Screenshot from 2024-11-19 02-34-25.png deleted file mode 100644 index f8e196b0..00000000 Binary files a/public/docs/gitbook/Screenshot from 2024-11-19 02-34-25.png and /dev/null differ diff --git a/public/docs/gitbook/Screenshot from 2024-11-19 02-34-49.png b/public/docs/gitbook/Screenshot from 2024-11-19 02-34-49.png deleted file mode 100644 index d55c5084..00000000 Binary files a/public/docs/gitbook/Screenshot from 2024-11-19 02-34-49.png and /dev/null differ diff --git a/public/docs/gitbook/Screenshot from 2024-11-19 02-35-10.png b/public/docs/gitbook/Screenshot from 2024-11-19 02-35-10.png deleted file mode 100644 index 50bd3b5a..00000000 Binary files a/public/docs/gitbook/Screenshot from 2024-11-19 02-35-10.png and /dev/null differ diff --git a/public/docs/gitbook/Select Wallet.png b/public/docs/gitbook/Select Wallet.png deleted file mode 100644 index 59427bf4..00000000 Binary files a/public/docs/gitbook/Select Wallet.png and /dev/null differ diff --git a/public/docs/gitbook/Success.png b/public/docs/gitbook/Success.png deleted file mode 100644 index 64de422f..00000000 Binary files a/public/docs/gitbook/Success.png and /dev/null differ diff --git a/public/docs/gitbook/Terms of Use.pdf b/public/docs/gitbook/Terms of Use.pdf deleted file mode 100644 index b19984c9..00000000 Binary files a/public/docs/gitbook/Terms of Use.pdf and /dev/null differ diff --git a/public/docs/gitbook/The_Doubling-1.png b/public/docs/gitbook/The_Doubling-1.png deleted file mode 100644 index eb287a86..00000000 Binary files a/public/docs/gitbook/The_Doubling-1.png and /dev/null differ diff --git a/public/docs/gitbook/Thesis Defense Mezo Portal Audit.pdf b/public/docs/gitbook/Thesis Defense Mezo Portal Audit.pdf deleted file mode 100644 index fa7b4938..00000000 Binary files a/public/docs/gitbook/Thesis Defense Mezo Portal Audit.pdf and /dev/null differ diff --git a/public/docs/gitbook/Thesis Defense OrangeKit Contract Audit.pdf b/public/docs/gitbook/Thesis Defense OrangeKit Contract Audit.pdf deleted file mode 100644 index 128b0f4c..00000000 Binary files a/public/docs/gitbook/Thesis Defense OrangeKit Contract Audit.pdf and /dev/null differ diff --git a/public/docs/gitbook/Your_Score.png b/public/docs/gitbook/Your_Score.png deleted file mode 100644 index 04f96e33..00000000 Binary files a/public/docs/gitbook/Your_Score.png and /dev/null differ diff --git a/public/docs/gitbook/header_banner.png b/public/docs/gitbook/header_banner.png deleted file mode 100644 index b015441e..00000000 Binary files a/public/docs/gitbook/header_banner.png and /dev/null differ diff --git a/public/docs/gitbook/image (1).png b/public/docs/gitbook/image (1).png deleted file mode 100644 index 08c3c37f..00000000 Binary files a/public/docs/gitbook/image (1).png and /dev/null differ diff --git a/public/docs/gitbook/image (10).png b/public/docs/gitbook/image (10).png deleted file mode 100644 index 2754b502..00000000 Binary files a/public/docs/gitbook/image (10).png and /dev/null differ diff --git a/public/docs/gitbook/image (11).png b/public/docs/gitbook/image (11).png deleted file mode 100644 index 9a17da16..00000000 Binary files a/public/docs/gitbook/image (11).png and /dev/null differ diff --git a/public/docs/gitbook/image (12).png b/public/docs/gitbook/image (12).png deleted file mode 100644 index f2491b80..00000000 Binary files a/public/docs/gitbook/image (12).png and /dev/null differ diff --git a/public/docs/gitbook/image (13).png b/public/docs/gitbook/image (13).png deleted file mode 100644 index f97faeff..00000000 Binary files a/public/docs/gitbook/image (13).png and /dev/null differ diff --git a/public/docs/gitbook/image (14).png b/public/docs/gitbook/image (14).png deleted file mode 100644 index 05f2ed07..00000000 Binary files a/public/docs/gitbook/image (14).png and /dev/null differ diff --git a/public/docs/gitbook/image (15).png b/public/docs/gitbook/image (15).png deleted file mode 100644 index 5e06c125..00000000 Binary files a/public/docs/gitbook/image (15).png and /dev/null differ diff --git a/public/docs/gitbook/image (16).png b/public/docs/gitbook/image (16).png deleted file mode 100644 index b04e6892..00000000 Binary files a/public/docs/gitbook/image (16).png and /dev/null differ diff --git a/public/docs/gitbook/image (17).png b/public/docs/gitbook/image (17).png deleted file mode 100644 index 05f2ed07..00000000 Binary files a/public/docs/gitbook/image (17).png and /dev/null differ diff --git a/public/docs/gitbook/image (18).png b/public/docs/gitbook/image (18).png deleted file mode 100644 index b04e6892..00000000 Binary files a/public/docs/gitbook/image (18).png and /dev/null differ diff --git a/public/docs/gitbook/image (19).png b/public/docs/gitbook/image (19).png deleted file mode 100644 index 05f2ed07..00000000 Binary files a/public/docs/gitbook/image (19).png and /dev/null differ diff --git a/public/docs/gitbook/image (2).png b/public/docs/gitbook/image (2).png deleted file mode 100644 index bb23a455..00000000 Binary files a/public/docs/gitbook/image (2).png and /dev/null differ diff --git a/public/docs/gitbook/image (20).png b/public/docs/gitbook/image (20).png deleted file mode 100644 index 5c2d0539..00000000 Binary files a/public/docs/gitbook/image (20).png and /dev/null differ diff --git a/public/docs/gitbook/image (21).png b/public/docs/gitbook/image (21).png deleted file mode 100644 index 933d85d1..00000000 Binary files a/public/docs/gitbook/image (21).png and /dev/null differ diff --git a/public/docs/gitbook/image (22).png b/public/docs/gitbook/image (22).png deleted file mode 100644 index 9acab179..00000000 Binary files a/public/docs/gitbook/image (22).png and /dev/null differ diff --git a/public/docs/gitbook/image (23).png b/public/docs/gitbook/image (23).png deleted file mode 100644 index a8891b61..00000000 Binary files a/public/docs/gitbook/image (23).png and /dev/null differ diff --git a/public/docs/gitbook/image (3).png b/public/docs/gitbook/image (3).png deleted file mode 100644 index e1e5558d..00000000 Binary files a/public/docs/gitbook/image (3).png and /dev/null differ diff --git a/public/docs/gitbook/image (4).png b/public/docs/gitbook/image (4).png deleted file mode 100644 index 2e993745..00000000 Binary files a/public/docs/gitbook/image (4).png and /dev/null differ diff --git a/public/docs/gitbook/image (5).png b/public/docs/gitbook/image (5).png deleted file mode 100644 index 3f6adb17..00000000 Binary files a/public/docs/gitbook/image (5).png and /dev/null differ diff --git a/public/docs/gitbook/image (6).png b/public/docs/gitbook/image (6).png deleted file mode 100644 index 81d2c811..00000000 Binary files a/public/docs/gitbook/image (6).png and /dev/null differ diff --git a/public/docs/gitbook/image (7).png b/public/docs/gitbook/image (7).png deleted file mode 100644 index af5d3bea..00000000 Binary files a/public/docs/gitbook/image (7).png and /dev/null differ diff --git a/public/docs/gitbook/image (8).png b/public/docs/gitbook/image (8).png deleted file mode 100644 index ed57cb87..00000000 Binary files a/public/docs/gitbook/image (8).png and /dev/null differ diff --git a/public/docs/gitbook/image (9).png b/public/docs/gitbook/image (9).png deleted file mode 100644 index 67c606c4..00000000 Binary files a/public/docs/gitbook/image (9).png and /dev/null differ diff --git a/public/docs/gitbook/image.gif b/public/docs/gitbook/image.gif deleted file mode 100644 index b2fb0de3..00000000 Binary files a/public/docs/gitbook/image.gif and /dev/null differ diff --git a/public/docs/gitbook/image.png b/public/docs/gitbook/image.png deleted file mode 100644 index b43bf9b5..00000000 Binary files a/public/docs/gitbook/image.png and /dev/null differ diff --git a/public/docs/gitbook/image.webp b/public/docs/gitbook/image.webp deleted file mode 100644 index f6228f8a..00000000 Binary files a/public/docs/gitbook/image.webp and /dev/null differ diff --git a/public/docs/gitbook/mats_calc_final (1).pdf b/public/docs/gitbook/mats_calc_final (1).pdf deleted file mode 100644 index f2b193ad..00000000 Binary files a/public/docs/gitbook/mats_calc_final (1).pdf and /dev/null differ diff --git a/public/docs/gitbook/mats_calc_final.pdf b/public/docs/gitbook/mats_calc_final.pdf deleted file mode 100644 index f2b193ad..00000000 Binary files a/public/docs/gitbook/mats_calc_final.pdf and /dev/null differ diff --git a/public/docs/gitbook/mezo-head.png b/public/docs/gitbook/mezo-head.png deleted file mode 100644 index 8a814da6..00000000 Binary files a/public/docs/gitbook/mezo-head.png and /dev/null differ diff --git a/public/docs/gitbook/stBTC Audit - Thesis Defense.pdf b/public/docs/gitbook/stBTC Audit - Thesis Defense.pdf deleted file mode 100644 index b276155d..00000000 Binary files a/public/docs/gitbook/stBTC Audit - Thesis Defense.pdf and /dev/null differ diff --git a/public/docs/gitbook/stBTCmintgifd-ezgif.com-video-to-gif-converter.gif b/public/docs/gitbook/stBTCmintgifd-ezgif.com-video-to-gif-converter.gif deleted file mode 100644 index cee4bdb5..00000000 Binary files a/public/docs/gitbook/stBTCmintgifd-ezgif.com-video-to-gif-converter.gif and /dev/null differ diff --git a/public/docs/gitbook/superstack_mats_formula.pdf b/public/docs/gitbook/superstack_mats_formula.pdf deleted file mode 100644 index 24e8fb9a..00000000 Binary files a/public/docs/gitbook/superstack_mats_formula.pdf and /dev/null differ diff --git a/scripts/process-gitbook.js b/scripts/process-gitbook.js deleted file mode 100644 index 612b314f..00000000 --- a/scripts/process-gitbook.js +++ /dev/null @@ -1,530 +0,0 @@ -#!/usr/bin/env node - -import fs from 'fs/promises'; -import path from 'path'; -import { fileURLToPath } from 'url'; -import yaml from 'js-yaml'; -import matter from 'gray-matter'; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); - -const DOCS_DIR = path.join(__dirname, '../src/content/docs/docs'); -const SUMMARY_FILE = path.join(DOCS_DIR, 'SUMMARY.md'); -const CONFIG_FILE = path.join(__dirname, '../astro.config.mjs'); -const ASSETS_SOURCE = path.join(__dirname, '../public/docs/gitbook'); -const ASSETS_TARGET = path.join(__dirname, '../src/assets/gitbook'); - -// Custom sidebar label overrides: slug → display label -const SIDEBAR_LABEL_OVERRIDES = { - 'docs/developers/chains': 'Network & RPC', -}; - -class GitbookProcessor { - constructor() { - this.summaryStructure = null; - this.topicConfig = []; - } - - getRelativeAssetPath(filePath, assetFile) { - const assetPath = path.join(__dirname, '../src/assets', assetFile); - const relativeAssetPath = path.relative(path.dirname(filePath), assetPath); - return relativeAssetPath.split(path.sep).join('/'); - } - - getRelativeComponentPath(filePath, componentFile) { - const componentPath = path.join(__dirname, '../src/components', componentFile); - const relativeComponentPath = path.relative(path.dirname(filePath), componentPath); - return relativeComponentPath.split(path.sep).join('/'); - } - - updateSplashHeroImage(frontmatter, filePath) { - if (!frontmatter?.hero?.image?.file) { - return; - } - - if (!frontmatter.hero.image.file.endsWith('Mezo-Mark-Red.svg')) { - return; - } - - frontmatter.hero.image.file = this.getRelativeAssetPath(filePath, 'Mezo-Mark-Red.svg'); - } - - async process() { - console.log('🔄 Processing Gitbook content for Starlight...'); - - try { - // Step 1: Parse SUMMARY.md to understand structure - await this.parseSummary(); - - // Step 2: Generate topic configuration - await this.generateTopicConfig(); - - // Step 3: Process markdown files - await this.processMarkdownFiles(); - - // Step 4: Move and process assets - await this.processAssets(); - - // Step 5: Update Astro config - await this.updateAstroConfig(); - - console.log('✅ Gitbook processing complete!'); - } catch (error) { - console.error('❌ Error processing Gitbook content:', error); - process.exit(1); - } - } - - async parseSummary() { - console.log('📖 Parsing SUMMARY.md...'); - - const summaryContent = await fs.readFile(SUMMARY_FILE, 'utf-8'); - this.summaryStructure = this.parseSummaryContent(summaryContent); - } - - parseSummaryContent(content) { - const lines = content.split('\n').filter(line => line.trim()); - const structure = []; - const stack = [{ children: structure, level: -1 }]; - - for (const line of lines) { - if (line.startsWith('#') || !line.includes('](')) continue; - - const level = (line.match(/^ */)[0].length) / 2; - const match = line.match(/\* \[([^\]]+)\]\(([^)]+)\)/); - - if (!match) continue; - - const [, title, path] = match; - const item = { title, path, children: [] }; - - // Find the correct parent - while (stack.length > 0 && stack[stack.length - 1].level >= level) { - stack.pop(); - } - - const parent = stack[stack.length - 1]; - parent.children.push(item); - stack.push({ ...item, level }); - } - - return structure; - } - - async generateTopicConfig() { - console.log('🏗️ Generating topic configuration...'); - - const topics = []; - - for (const section of this.summaryStructure) { - if (section.path === 'README.md' || section.path === 'index.md') continue; - - const sectionPath = section.path.replace(/\/README\.md$/, '').replace(/\.md$/, ''); - - if (sectionPath === 'users') { - topics.push(await this.generateUsersTopic(section)); - } else if (sectionPath === 'developers') { - topics.push(await this.generateDevelopersTopic(section)); - } else if (sectionPath === 'admins') { - topics.push(await this.generateAdminsTopic(section)); - } - } - - this.topicConfig = topics; - } - - async generateUsersTopic(section) { - return { - label: 'User Documentation', - id: 'users', - link: '/docs/users/', - icon: 'star', - items: await this.convertChildrenToItems(section.children, 'docs/') - }; - } - - async generateDevelopersTopic(section) { - return { - label: 'Developer Documentation', - id: 'developers', - link: '/docs/developers/', - icon: 'seti:powershell', - items: await this.convertChildrenToItems(section.children, 'docs/') - }; - } - - async generateAdminsTopic(section) { - return { - label: 'Admin Documentation', - id: 'admins', - link: '/docs/admins/', - icon: 'setting', - items: await this.convertChildrenToItems(section.children, 'docs/') - }; - } - - async convertChildrenToItems(children, prefix = '') { - const items = []; - - for (const child of children) { - let cleanPath = child.path - .replace(/\/README\.md$/, '') - .replace(/\.mdx?$/, '') - .toLowerCase(); // Normalize to lowercase to match Astro's slug generation - - // Handle special case for index files - don't include "index" in the slug - if (cleanPath.endsWith('/index')) { - cleanPath = cleanPath.slice(0, -6); // remove "/index" - } - - const link = `${prefix}${cleanPath}`; - - // Check if this page is hidden by reading its frontmatter - const isHidden = await this.isPageHidden(child.path); - - if (child.children && child.children.length > 0) { - const childItems = await this.convertChildrenToItems(child.children, prefix); - - // Only include the group if it has visible children or is not hidden itself - if (childItems.length > 0 || !isHidden) { - items.push({ - label: this.humanizeTitle(child.title), - collapsed: true, - items: childItems - }); - } - } else if (!isHidden) { - // Only include non-hidden pages - if (typeof link === 'string' && link.length > prefix.length) { - if (SIDEBAR_LABEL_OVERRIDES[link]) { - items.push({ slug: link, label: SIDEBAR_LABEL_OVERRIDES[link] }); - } else { - items.push(link); - } - } - } - } - - return items; - } - - async processMarkdownFiles() { - console.log('📝 Processing markdown files...'); - - await this.processDirectory(DOCS_DIR); - } - - async processDirectory(dir) { - const entries = await fs.readdir(dir, { withFileTypes: true }); - - for (const entry of entries) { - const fullPath = path.join(dir, entry.name); - - if (entry.isDirectory()) { - await this.processDirectory(fullPath); - } else if (entry.name.match(/\.mdx?$/)) { - await this.processMarkdownFile(fullPath); - } - } - } - - async processMarkdownFile(filePath) { - const content = await fs.readFile(filePath, 'utf-8'); - const processed = this.transformMarkdownContent(content, filePath); - - if (processed !== content) { - await fs.writeFile(filePath, processed, 'utf-8'); - console.log(` ✏️ Processed: ${path.relative(DOCS_DIR, filePath)}`); - } - } - - transformMarkdownContent(content, filePath) { - let transformed = content; - const relativePath = path.relative(DOCS_DIR, filePath); - - // Special handling for the main docs index page - if (relativePath === 'README.md' || relativePath === 'index.md') { - return this.transformDocsIndexPage(content, filePath); - } - - // Transform Gitbook button blocks - transformed = transformed.replace( - /\\?\[block:buttons\]\\?\s*\{[^}]*"buttons":\s*\\?\[(.*?)\\?\]\s*\}[^\\]*\\?\[\/block:buttons\]\\?/gs, - (match, buttonsJson) => { - try { - const buttons = JSON.parse(`[${buttonsJson}]`); - return buttons.map(btn => - `[${btn.text}](${btn.link})` - ).join(' • '); - } catch (e) { - console.warn(`Failed to parse buttons in ${filePath}`); - return match; - } - } - ); - - // Transform Gitbook image references to asset references - transformed = transformed.replace( - /!\[([^\]]*)\]\(\.\.\/\.\.\/\.\.\/docs\/gitbook\/([^)]+)\)/g, - '![](~/assets/gitbook/$2)' - ); - - transformed = transformed.replace( - /import RedirectScript from ["'][^"']*components\/RedirectScript\.astro["'];/g, - `import RedirectScript from "${this.getRelativeComponentPath(filePath, 'RedirectScript.astro')}";` - ); - - // Handle frontmatter and topic assignment using gray-matter - const parsed = matter(transformed); - const topicId = this.inferTopicFromPath(relativePath); - - // Update frontmatter data - if (!parsed.data.title) { - const filename = path.basename(filePath, path.extname(filePath)); - parsed.data.title = filename === 'README' || filename === 'index' - ? this.inferTitleFromPath(filePath) - : filename.replace(/-/g, ' ').replace(/\b\w/g, l => l.toUpperCase()); - } - - if (topicId && !parsed.data.topic) { - parsed.data.topic = topicId; - } - - this.updateSplashHeroImage(parsed.data, filePath); - - // Preserve hidden status - don't modify if it already exists - // (This ensures Gitbook's hidden: true setting is maintained) - - // Regenerate the content with updated frontmatter - transformed = matter.stringify(parsed.content, parsed.data); - - // Clean up any remaining Gitbook syntax - transformed = transformed.replace(/\[block:[^\]]+\][^[]*\[\/block:[^\]]+\]/gs, ''); - - return transformed; - } - - inferTitleFromPath(filePath) { - const relativePath = path.relative(DOCS_DIR, filePath); - const parts = relativePath.split('/').filter(part => part !== 'README.md' && part !== 'index.md'); - return parts[parts.length - 1] || 'Documentation'; - } - - inferTopicFromPath(relativePath) { - // Determine topic based on file path - if (relativePath.startsWith('users/')) { - return 'users'; - } else if (relativePath.startsWith('developers/')) { - return 'developers'; - } else if (relativePath.startsWith('admins/')) { - return 'admins'; - } else if (relativePath === 'README.md' || relativePath === 'index.md' || relativePath === 'SUMMARY.md') { - return 'users'; // Default root files to users topic - } - return null; - } - - transformDocsIndexPage(content, filePath) { - // Parse existing frontmatter and content using gray-matter - const parsed = matter(content); - - // Extract title and tagline from content - let title = parsed.data.title || 'Welcome to Mezo Docs'; - let tagline = 'Turn your Bitcoin into an active, yield-generating asset with BitcoinFi.'; - - // Try to extract tagline from content body - let bodyContent = parsed.content; - - // Extract action buttons directly from GitBook button blocks BEFORE transforming them - const actions = []; - const gitbookButtonPattern = /\\?\[block:buttons\]\\?\s*\{[^}]*"buttons":\s*\\?\[(.*?)\\?\]\s*\}[^\\]*\\?\[\/block:buttons\]\\?/gs; - let buttonMatch; - - while ((buttonMatch = gitbookButtonPattern.exec(bodyContent)) !== null) { - try { - const [, buttonsJson] = buttonMatch; - const buttons = JSON.parse(`[${buttonsJson}]`); - - buttons.forEach((btn, index) => { - const action = { - text: btn.text, - link: btn.link, - icon: 'right-arrow' - }; - - // Make the second button secondary variant - if (index === 1) { - action.variant = 'secondary'; - } - - actions.push(action); - }); - } catch (e) { - console.warn(`Failed to parse buttons in ${filePath}:`, e.message); - } - } - - // Now transform Gitbook button blocks to simple links for tagline extraction - bodyContent = bodyContent.replace( - /\\?\[block:buttons\]\\?\s*\{[^}]*"buttons":\s*\\?\[(.*?)\\?\]\s*\}[^\\]*\\?\[\/block:buttons\]\\?/gs, - (match, buttonsJson) => { - try { - const buttons = JSON.parse(`[${buttonsJson}]`); - return buttons.map(btn => - `[${btn.text}](${btn.link})` - ).join(' • '); - } catch (e) { - console.warn(`Failed to parse buttons in ${filePath}`); - return match; - } - } - ); - - const lines = bodyContent.split('\n').filter(line => line.trim()); - - // Look for a paragraph that might be the tagline - for (const line of lines) { - if (line.startsWith('#')) continue; // Skip headers - if (line.includes('[') && line.includes(']')) continue; // Skip links - if (line.trim() && !line.startsWith('*') && !line.startsWith('-')) { - tagline = line.trim(); - break; - } - } - - // Generate the splash page frontmatter - const frontmatterData = { - title: title, - topic: 'users', - template: 'splash', - hero: { - tagline: tagline, - image: { - file: this.getRelativeAssetPath(filePath, 'Mezo-Mark-Red.svg') - }, - actions: actions - } - }; - - // Convert to YAML format using proper library - const yamlContent = yaml.dump(frontmatterData, { - indent: 2, - lineWidth: -1, // No line wrapping - noRefs: true, // Don't use references - sortKeys: false // Preserve key order - }); - - return `---\n${yamlContent}---\n`; - } - - humanizeTitle(title) { - // Convert slug-like titles to human-readable format - return title - .replace(/[-_]/g, ' ') // Replace dashes and underscores with spaces - .replace(/\b\w/g, l => l.toUpperCase()) // Capitalize first letter of each word - .replace(/\bmusd\b/gi, 'MUSD') // Special case for MUSD - .replace(/\bmats\b/gi, 'mats') // Special case for mats (keep lowercase) - .replace(/\bbtc\b/gi, 'BTC') // Special case for BTC - .replace(/\bstbtc\b/gi, 'stBTC') // Special case for stBTC - .replace(/\btbtc\b/gi, 'tBTC') // Special case for tBTC - .replace(/\bvebtc\b/gi, 'veBTC') // Special case for veBTC - .replace(/\bvemezo\b/gi, 'veMEZO') // Special case for veMEZO - .replace(/\berc\b/gi, 'ERC') // Special case for ERC - .replace(/\bapi\b/gi, 'API') // Special case for API - .replace(/\bfaq\b/gi, 'FAQ'); // Special case for FAQ - } - - async isPageHidden(relativePath) { - try { - const fullPath = path.join(DOCS_DIR, relativePath); - - // Check if file exists - try { - await fs.access(fullPath); - } catch { - return false; // File doesn't exist, not hidden - } - - const content = await fs.readFile(fullPath, 'utf-8'); - const parsed = matter(content); - - // Check if the page has hidden: true in frontmatter - return parsed.data.hidden === true; - } catch (error) { - console.warn(` ⚠️ Could not check hidden status for ${relativePath}:`, error.message); - return false; // Default to not hidden if we can't determine - } - } - - async processAssets() { - console.log('🖼️ Processing assets...'); - - try { - // Create target directory - await fs.mkdir(ASSETS_TARGET, { recursive: true }); - - // Check if source exists - try { - await fs.access(ASSETS_SOURCE); - } catch { - console.log(' ℹ️ No gitbook assets found, skipping...'); - return; - } - - // Copy assets - await this.copyDirectory(ASSETS_SOURCE, ASSETS_TARGET); - console.log(' ✅ Assets copied to src/assets/gitbook/'); - } catch (error) { - console.warn(' ⚠️ Could not process assets:', error.message); - } - } - - async copyDirectory(src, dest) { - await fs.mkdir(dest, { recursive: true }); - const entries = await fs.readdir(src, { withFileTypes: true }); - - for (const entry of entries) { - const srcPath = path.join(src, entry.name); - const destPath = path.join(dest, entry.name); - - if (entry.isDirectory()) { - await this.copyDirectory(srcPath, destPath); - } else { - await fs.copyFile(srcPath, destPath); - } - } - } - - async updateAstroConfig() { - console.log('⚙️ Updating Astro configuration...'); - - const configContent = await fs.readFile(CONFIG_FILE, 'utf-8'); - - // Generate the new topics configuration - const topicsConfig = this.generateTopicsConfigString(); - - // Replace the existing starlightSidebarTopics configuration with a more robust pattern - const updatedConfig = configContent.replace( - /starlightSidebarTopics\(\s*\[[\s\S]*?\]\s*\)/, - `starlightSidebarTopics(${topicsConfig})` - ); - - if (updatedConfig !== configContent) { - await fs.writeFile(CONFIG_FILE, updatedConfig, 'utf-8'); - console.log(' ✅ Astro config updated with generated topics'); - } else { - console.log(' ℹ️ No changes needed to Astro config'); - } - } - - generateTopicsConfigString() { - return JSON.stringify(this.topicConfig, null, 6) - .replace(/"(\w+)":/g, '$1:') // Remove quotes from object keys - .replace(/"/g, "'"); // Use single quotes for strings - } -} - -// Run the processor -const processor = new GitbookProcessor(); -processor.process(); diff --git a/src/content/docs/docs/de/docs/404/index.mdx b/src/content/docs/docs/de/docs/404/index.mdx index 34cf1c9d..0abf8fc5 100644 --- a/src/content/docs/docs/de/docs/404/index.mdx +++ b/src/content/docs/docs/de/docs/404/index.mdx @@ -4,7 +4,7 @@ topic: developers --- import { LinkButton } from "@astrojs/starlight/components"; -import RedirectScript from "../../../../../components/RedirectScript.astro"; +import RedirectScript from "../../../../../../components/RedirectScript.astro"; ## Entschuldigung, wir konnten diese Seite nicht finden diff --git a/src/content/docs/docs/es/docs/404/index.mdx b/src/content/docs/docs/es/docs/404/index.mdx index 674e0beb..b5d31e56 100644 --- a/src/content/docs/docs/es/docs/404/index.mdx +++ b/src/content/docs/docs/es/docs/404/index.mdx @@ -4,7 +4,7 @@ topic: developers --- import { LinkButton } from "@astrojs/starlight/components"; -import RedirectScript from "../../../../../components/RedirectScript.astro"; +import RedirectScript from "../../../../../../components/RedirectScript.astro"; ## Lo sentimos, no pudimos encontrar esa página diff --git a/src/content/docs/docs/fr/docs/404/index.mdx b/src/content/docs/docs/fr/docs/404/index.mdx index 466983c6..657c36c6 100644 --- a/src/content/docs/docs/fr/docs/404/index.mdx +++ b/src/content/docs/docs/fr/docs/404/index.mdx @@ -4,7 +4,7 @@ topic: developers --- import { LinkButton } from "@astrojs/starlight/components"; -import RedirectScript from "../../../../../components/RedirectScript.astro"; +import RedirectScript from "../../../../../../components/RedirectScript.astro"; ## Désolé, nous n'avons pas pu trouver cette page diff --git a/src/content/docs/docs/in/docs/404/index.mdx b/src/content/docs/docs/in/docs/404/index.mdx index 6b76d052..6f6a41a2 100644 --- a/src/content/docs/docs/in/docs/404/index.mdx +++ b/src/content/docs/docs/in/docs/404/index.mdx @@ -4,7 +4,7 @@ topic: developers --- import { LinkButton } from "@astrojs/starlight/components"; -import RedirectScript from "../../../../../components/RedirectScript.astro"; +import RedirectScript from "../../../../../../components/RedirectScript.astro"; ## क्षमा करें, हम वह पृष्ठ नहीं ढूंढ पाए diff --git a/src/content/docs/docs/kr/docs/404/index.mdx b/src/content/docs/docs/kr/docs/404/index.mdx index 9c39ed25..e5afe1f2 100644 --- a/src/content/docs/docs/kr/docs/404/index.mdx +++ b/src/content/docs/docs/kr/docs/404/index.mdx @@ -4,7 +4,7 @@ topic: developers --- import { LinkButton } from "@astrojs/starlight/components"; -import RedirectScript from "../../../../../components/RedirectScript.astro"; +import RedirectScript from "../../../../../../components/RedirectScript.astro"; ## 죄송합니다, 해당 페이지를 찾을 수 없습니다 diff --git a/src/content/docs/docs/nl/docs/404/index.mdx b/src/content/docs/docs/nl/docs/404/index.mdx index de12feac..0f1a22c3 100644 --- a/src/content/docs/docs/nl/docs/404/index.mdx +++ b/src/content/docs/docs/nl/docs/404/index.mdx @@ -4,7 +4,7 @@ topic: developers --- import { LinkButton } from "@astrojs/starlight/components"; -import RedirectScript from "../../../../../components/RedirectScript.astro"; +import RedirectScript from "../../../../../../components/RedirectScript.astro"; ## Sorry, we konden die pagina niet vinden diff --git a/src/content/docs/docs/pt-br/docs/404/index.mdx b/src/content/docs/docs/pt-br/docs/404/index.mdx index e0e0e867..2cd57979 100644 --- a/src/content/docs/docs/pt-br/docs/404/index.mdx +++ b/src/content/docs/docs/pt-br/docs/404/index.mdx @@ -4,7 +4,7 @@ topic: developers --- import { LinkButton } from "@astrojs/starlight/components"; -import RedirectScript from "../../../../../components/RedirectScript.astro"; +import RedirectScript from "../../../../../../components/RedirectScript.astro"; ## Desculpe, não conseguimos encontrar essa página diff --git a/src/content/docs/docs/ru/docs/404/index.mdx b/src/content/docs/docs/ru/docs/404/index.mdx index 895ad036..7625dd97 100644 --- a/src/content/docs/docs/ru/docs/404/index.mdx +++ b/src/content/docs/docs/ru/docs/404/index.mdx @@ -4,7 +4,7 @@ topic: developers --- import { LinkButton } from "@astrojs/starlight/components"; -import RedirectScript from "../../../../../components/RedirectScript.astro"; +import RedirectScript from "../../../../../../components/RedirectScript.astro"; ## Извините, мы не смогли найти эту страницу diff --git a/src/content/docs/docs/ua/docs/404/index.mdx b/src/content/docs/docs/ua/docs/404/index.mdx index 121a4bdc..7c23939e 100644 --- a/src/content/docs/docs/ua/docs/404/index.mdx +++ b/src/content/docs/docs/ua/docs/404/index.mdx @@ -4,7 +4,7 @@ topic: developers --- import { LinkButton } from "@astrojs/starlight/components"; -import RedirectScript from "../../../../../components/RedirectScript.astro"; +import RedirectScript from "../../../../../../components/RedirectScript.astro"; ## Вибачте, ми не змогли знайти цю сторінку diff --git a/src/content/docs/docs/vn/docs/404/index.mdx b/src/content/docs/docs/vn/docs/404/index.mdx index 0f0e7b1f..6bd666f4 100644 --- a/src/content/docs/docs/vn/docs/404/index.mdx +++ b/src/content/docs/docs/vn/docs/404/index.mdx @@ -4,7 +4,7 @@ topic: developers --- import { LinkButton } from "@astrojs/starlight/components"; -import RedirectScript from "../../../../../components/RedirectScript.astro"; +import RedirectScript from "../../../../../../components/RedirectScript.astro"; ## Xin lỗi, chúng tôi không thể tìm thấy trang đó diff --git a/src/content/docs/docs/zh/docs/404/index.mdx b/src/content/docs/docs/zh/docs/404/index.mdx index 9e2efa54..3c379661 100644 --- a/src/content/docs/docs/zh/docs/404/index.mdx +++ b/src/content/docs/docs/zh/docs/404/index.mdx @@ -4,7 +4,7 @@ topic: developers --- import { LinkButton } from "@astrojs/starlight/components"; -import RedirectScript from "../../../../../components/RedirectScript.astro"; +import RedirectScript from "../../../../../../components/RedirectScript.astro"; ## 抱歉,我们无法找到该页面