From 8c829988cc35d7d1683a2f1c68b96e5abb876465 Mon Sep 17 00:00:00 2001 From: Albert Castellana Date: Thu, 11 Jun 2026 11:48:54 +0200 Subject: [PATCH 01/10] feat(llm): fix LLM export pipeline, sitemap hygiene, robots.txt, redirects - generate-full-docs.js: include .md pages (SDK API refs were missing), sweep files not listed in _meta.json (recovers CLI subtrees), convert JSX (Callout/Cards/Tabs/Image) to plain markdown, prepend canonical Source: URLs, guarantee H1 per page, drop "page has moved" stubs - generate-sitemap-xml.js: exclude hidden _-prefixed paths, include .md routes, fix nested index URLs - next.config.js: fix 4 redirects pointing at the removed advanced-features/ tree (they 404ed), redirect deleted duplicate page - delete duplicate features/features.mdx, add LibertAI to partners nav - add robots.txt explicitly allowing AI crawlers, linking sitemap Co-Authored-By: Claude Fable 5 --- next.config.js | 18 +- .../features/features.mdx | 27 - pages/partners/_meta.json | 1 + public/robots.txt | 49 ++ public/sitemap.xml | 804 ++++++++++++++---- scripts/generate-full-docs.js | 234 ++++- scripts/generate-sitemap-xml.js | 17 +- 7 files changed, 914 insertions(+), 236 deletions(-) delete mode 100644 pages/developers/intelligent-contracts/features/features.mdx create mode 100644 public/robots.txt diff --git a/next.config.js b/next.config.js index b7ff90fc3..e62540efd 100644 --- a/next.config.js +++ b/next.config.js @@ -54,7 +54,7 @@ const previousRedirects = [ { old: "/build-with-genlayer/use-cases/llm-erc20", new: "/developers/intelligent-contracts/ideas" }, { old: "/advanced-features/:page*", - new: "/developers/intelligent-contracts/advanced-features/:page*", + new: "/developers/intelligent-contracts/features/:page*", }, { old: "/core-concepts/intelligent-contracts", new: "/developers/intelligent-contracts/introduction" }, { @@ -85,7 +85,7 @@ const actualRedirects = [ }, { old: "/build-with-genlayer/intelligent-contracts/advanced-features/:page*", - new: "/developers/intelligent-contracts/advanced-features/:page*", + new: "/developers/intelligent-contracts/features/:page*", }, { old: "/build-with-genlayer/use-cases/:page*", @@ -148,8 +148,16 @@ const actualRedirects = [ new: "/developers/intelligent-contracts/examples/storage", }, { - old: "/developers/intelligent-contracts/advanced-features", - new: "/developers/intelligent-contracts/advanced-features/contract-to-contract-interaction", + old: "/developers/intelligent-contracts/advanced-features/:page*", + new: "/developers/intelligent-contracts/features/:page*", + }, + { + old: "/developers/intelligent-contracts/features/contract-to-contract-interaction", + new: "/developers/intelligent-contracts/features/interacting-with-intelligent-contracts", + }, + { + old: "/developers/intelligent-contracts/features/features", + new: "/developers/intelligent-contracts/features", }, { old: "/developers/intelligent-contracts/testing-and-debugging", @@ -161,7 +169,7 @@ const actualRedirects = [ }, { old: "/developers/intelligent-contracts/error-handling", - new: "/developers/intelligent-contracts/advanced-features/error-handling", + new: "/developers/intelligent-contracts/features/error-handling", }, ]; diff --git a/pages/developers/intelligent-contracts/features/features.mdx b/pages/developers/intelligent-contracts/features/features.mdx deleted file mode 100644 index 31c26894a..000000000 --- a/pages/developers/intelligent-contracts/features/features.mdx +++ /dev/null @@ -1,27 +0,0 @@ -import { Card, Cards } from 'nextra-theme-docs' - -# Intelligent Contract Features - -## Deterministic Features - - - - - - - - - - - - - - - -## Non-Deterministic Features - - - - - - diff --git a/pages/partners/_meta.json b/pages/partners/_meta.json index 584d5bf23..5a0c2d701 100644 --- a/pages/partners/_meta.json +++ b/pages/partners/_meta.json @@ -4,5 +4,6 @@ "ionet": "io.net", "comput3": "Comput3", "chutes": "Chutes", + "libertai": "LibertAI", "morpheus": "Morpheus" } \ No newline at end of file diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 000000000..43f7c7799 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,49 @@ +# GenLayer Documentation β€” https://docs.genlayer.com +# LLM-friendly resources: +# Docs index for LLMs: https://docs.genlayer.com/llms.txt +# Complete docs in one file: https://docs.genlayer.com/llms-full.txt + +User-agent: * +Allow: / + +# AI crawlers and assistants β€” explicitly welcome +User-agent: GPTBot +Allow: / + +User-agent: OAI-SearchBot +Allow: / + +User-agent: ChatGPT-User +Allow: / + +User-agent: ClaudeBot +Allow: / + +User-agent: Claude-SearchBot +Allow: / + +User-agent: Claude-User +Allow: / + +User-agent: PerplexityBot +Allow: / + +User-agent: Perplexity-User +Allow: / + +User-agent: Google-Extended +Allow: / + +User-agent: Bingbot +Allow: / + +User-agent: CCBot +Allow: / + +User-agent: meta-externalagent +Allow: / + +User-agent: Applebot-Extended +Allow: / + +Sitemap: https://docs.genlayer.com/sitemap.xml diff --git a/public/sitemap.xml b/public/sitemap.xml index 3aee10dad..a827b381c 100644 --- a/public/sitemap.xml +++ b/public/sitemap.xml @@ -2,817 +2,1279 @@ https://docs.genlayer.com/FAQ - 2026-03-09T15:19:14.172Z + 2026-06-11T08:56:09.941Z weekly 0.8 - https://docs.genlayer.com/_providers/ollama - 2026-03-09T15:19:14.173Z + https://docs.genlayer.com/api-references/genlayer-cli/accounts/account/create + 2026-06-11T08:56:09.941Z weekly 0.8 - https://docs.genlayer.com/_providers/openai - 2026-03-09T15:19:14.173Z + https://docs.genlayer.com/api-references/genlayer-cli/accounts/account/export + 2026-06-11T08:56:09.941Z weekly 0.8 - https://docs.genlayer.com/_temp/security-and-best-practices/grey-boxing - 2026-03-09T15:19:14.173Z + https://docs.genlayer.com/api-references/genlayer-cli/accounts/account/import + 2026-06-11T08:56:09.941Z weekly 0.8 - https://docs.genlayer.com/_temp/security-and-best-practices/universal-attacks - 2026-03-09T15:19:14.173Z + https://docs.genlayer.com/api-references/genlayer-cli/accounts/account/list + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/accounts/account/lock + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/accounts/account/remove + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/accounts/account/send + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/accounts/account/show + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/accounts/account/unlock + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/accounts/account/use + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/accounts/account + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/configuration/config/get + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/configuration/config/reset + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/configuration/config/set + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/configuration/config + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/configuration/network/info + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/configuration/network/list + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/configuration/network/set + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/configuration/network + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/contracts/call + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/contracts/code + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/contracts/deploy + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/contracts/schema + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/contracts/write + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/environment/init + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/environment/new + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/environment/stop + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/environment/up + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/environment/update/ollama + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/environment/update + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/finalize-batch + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/finalize + 2026-06-11T08:56:09.941Z weekly 0.8 https://docs.genlayer.com/api-references/genlayer-cli - 2026-03-09T15:19:14.173Z + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/localnet/localnet/validators/count + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/localnet/localnet/validators/create-random + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/localnet/localnet/validators/create + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/localnet/localnet/validators/delete + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/localnet/localnet/validators/get + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/localnet/localnet/validators/update + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/localnet/localnet/validators + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/localnet/localnet + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/active-validators + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/banned-validators + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/delegation-info + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/delegator-claim + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/delegator-exit + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/delegator-join + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/epoch-info + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/prime-all + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/quarantined-validators + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/set-identity + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/set-operator + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/validator-claim + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/validator-deposit + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/validator-exit + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/validator-history + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/validator-info + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/validator-join + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/validator-prime + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/validators + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/wizard + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/transactions/appeal-bond + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/transactions/appeal + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/transactions/receipt + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/transactions/trace + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-js/contracts + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-js/staking + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-js/transactions + 2026-06-11T08:56:09.941Z weekly 0.8 https://docs.genlayer.com/api-references/genlayer-js - 2026-03-09T15:19:14.173Z + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-linter + 2026-06-11T08:56:09.941Z weekly 0.8 https://docs.genlayer.com/api-references/genlayer-node/debug/gen_dbg_ping - 2026-03-09T15:19:14.174Z + 2026-06-11T08:56:09.941Z + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-node/debug/gen_dbg_traceTransaction + 2026-06-11T08:56:09.941Z weekly 0.8 https://docs.genlayer.com/api-references/genlayer-node/debug/gen_dbg_trie - 2026-03-09T15:19:14.174Z + 2026-06-11T08:56:09.941Z weekly 0.8 https://docs.genlayer.com/api-references/genlayer-node/gen/gen_call - 2026-03-09T15:19:14.174Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/api-references/genlayer-node/gen/gen_getContractCode - 2026-03-09T15:19:14.174Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/api-references/genlayer-node/gen/gen_getContractSchema - 2026-03-09T15:19:14.174Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/api-references/genlayer-node/gen/gen_getContractState - 2026-03-09T15:19:14.174Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/api-references/genlayer-node/gen/gen_getTransactionReceipt - 2026-03-09T15:19:14.174Z + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/api-references/genlayer-node/ops/balance - 2026-03-09T15:19:14.174Z + https://docs.genlayer.com/api-references/genlayer-node/gen/gen_getTransactionStatus + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/api-references/genlayer-node/ops/health - 2026-03-09T15:19:14.174Z + https://docs.genlayer.com/api-references/genlayer-node/gen/gen_syncing + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/api-references/genlayer-node/ops/metrics - 2026-03-09T15:19:14.175Z + https://docs.genlayer.com/api-references/genlayer-node/ops/balance + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/api-references/genlayer-node - 2026-03-09T16:05:27.624Z + https://docs.genlayer.com/api-references/genlayer-node/ops/health + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/api-references/genlayer-py - 2026-03-09T15:19:14.175Z + https://docs.genlayer.com/api-references/genlayer-node/ops/metrics + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/api-references/genlayer-test - 2026-03-09T15:19:14.175Z + https://docs.genlayer.com/api-references/genlayer-node/ops/snapshot + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/api-references - 2026-03-09T15:19:14.173Z + https://docs.genlayer.com/api-references/genlayer-node + 2026-06-11T08:56:09.941Z weekly 0.8 - https://docs.genlayer.com/developers/decentralized-applications/architecture-overview - 2026-03-09T15:19:14.175Z + https://docs.genlayer.com/api-references/genlayer-py/api + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/developers/decentralized-applications/dapp-development-workflow - 2026-03-09T15:19:14.175Z + https://docs.genlayer.com/api-references/genlayer-py + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/developers/decentralized-applications/genlayer-js - 2026-03-09T15:19:14.175Z + https://docs.genlayer.com/api-references/genlayer-test/direct + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/developers/decentralized-applications/project-boilerplate - 2026-03-09T15:19:14.175Z + https://docs.genlayer.com/api-references/genlayer-test/glsim + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/developers/decentralized-applications/querying-a-transaction - 2026-03-09T15:19:14.175Z + https://docs.genlayer.com/api-references/genlayer-test/integration + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/developers/decentralized-applications/reading-data - 2026-03-09T15:19:14.175Z + https://docs.genlayer.com/api-references/genlayer-test + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/developers/decentralized-applications/testing - 2026-03-09T15:19:14.175Z + https://docs.genlayer.com/api-references + 2026-06-11T08:56:09.941Z weekly 0.8 - https://docs.genlayer.com/developers/decentralized-applications/writing-data - 2026-03-09T15:19:14.176Z + https://docs.genlayer.com/developers/decentralized-applications/architecture-overview + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/crafting-prompts - 2026-03-09T15:19:14.176Z + https://docs.genlayer.com/developers/decentralized-applications/dapp-development-workflow + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/debugging - 2026-03-09T15:19:14.176Z + https://docs.genlayer.com/developers/decentralized-applications/genlayer-js + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/deploying/cli-deployment - 2026-03-09T15:19:14.176Z + https://docs.genlayer.com/developers/decentralized-applications/project-boilerplate + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/deploying/deploy-scripts - 2026-03-09T15:19:14.176Z + https://docs.genlayer.com/developers/decentralized-applications/querying-a-transaction + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/deploying/deployment-methods - 2026-03-09T15:19:14.176Z + https://docs.genlayer.com/developers/decentralized-applications/reading-data + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/deploying/network-configuration - 2026-03-09T15:19:14.176Z + https://docs.genlayer.com/developers/decentralized-applications/testing + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/deploying - 2026-03-09T15:19:14.176Z + https://docs.genlayer.com/developers/decentralized-applications/writing-data + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/equivalence-principle - 2026-03-09T15:19:14.176Z + https://docs.genlayer.com/developers/intelligent-contracts/crafting-prompts + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/examples/_advanced/_adr-validator - 2026-03-09T15:19:14.176Z + https://docs.genlayer.com/developers/intelligent-contracts/debugging + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/examples/_advanced/_flight-insurance - 2026-03-09T15:19:14.176Z + https://docs.genlayer.com/developers/intelligent-contracts/deploying/cli-deployment + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/examples/_advanced/_genlayer-dao - 2026-03-09T15:19:14.177Z + https://docs.genlayer.com/developers/intelligent-contracts/deploying/deploy-scripts + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/examples/_advanced/_git-bounties - 2026-03-09T15:19:14.177Z + https://docs.genlayer.com/developers/intelligent-contracts/deploying/deployment-methods + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/examples/_advanced/_influencer-tweet-analyzer - 2026-03-09T15:19:14.177Z + https://docs.genlayer.com/developers/intelligent-contracts/deploying/network-configuration + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/examples/_advanced/_purellm-dao - 2026-03-09T15:19:14.177Z + https://docs.genlayer.com/developers/intelligent-contracts/deploying + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/examples/_advanced/_rokos-mansion - 2026-03-09T15:19:14.177Z + https://docs.genlayer.com/developers/intelligent-contracts/equivalence-principle + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/examples/fetch-github-profile - 2026-03-09T15:19:14.177Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/examples/fetch-web-content - 2026-03-09T15:19:14.177Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/examples/github-profile-projects - 2026-03-09T15:19:14.177Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/examples/github-profile-summary - 2026-03-09T15:19:14.177Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/examples/llm-hello-world-non-comparative - 2026-03-09T15:19:14.177Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/examples/llm-hello-world - 2026-03-09T15:19:14.177Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/examples/prediction - 2026-03-09T15:19:14.177Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/examples/storage - 2026-03-09T15:19:14.177Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/examples/user-storage - 2026-03-09T15:19:14.177Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/examples/vector-store-log-indexer - 2026-03-09T15:19:14.178Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/examples/wizard-of-coin - 2026-03-09T15:19:14.178Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/balances - 2026-03-09T15:19:14.178Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/calling-llms - 2026-03-09T15:19:14.178Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/debugging - 2026-03-09T15:19:14.178Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/error-handling - 2026-03-09T15:19:14.178Z + 2026-06-11T08:56:09.951Z weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/features/features - 2026-03-09T15:19:14.178Z + https://docs.genlayer.com/developers/intelligent-contracts/features/image-processing + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/interacting-with-evm-contracts - 2026-03-09T15:19:14.178Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/interacting-with-intelligent-contracts - 2026-03-09T15:19:14.178Z + 2026-06-11T08:56:09.951Z + weekly + 0.8 + + + https://docs.genlayer.com/developers/intelligent-contracts/features/messages + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/non-determinism - 2026-03-09T15:19:14.178Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/random - 2026-03-09T15:19:14.178Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/special-methods - 2026-03-09T15:19:14.178Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/storage - 2026-03-09T15:19:14.178Z + 2026-06-11T08:56:09.951Z + weekly + 0.8 + + + https://docs.genlayer.com/developers/intelligent-contracts/features/transaction-context + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/upgradability - 2026-03-09T15:19:14.178Z + 2026-06-11T08:56:09.951Z + weekly + 0.8 + + + https://docs.genlayer.com/developers/intelligent-contracts/features/value-transfers + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/vector-storage - 2026-03-09T15:19:14.178Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/web-access - 2026-03-09T15:19:14.178Z + 2026-06-11T08:56:09.951Z + weekly + 0.8 + + + https://docs.genlayer.com/developers/intelligent-contracts/features + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/first-contract - 2026-03-09T15:19:14.179Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/first-intelligent-contract - 2026-03-09T15:19:14.179Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/ideas - 2026-03-09T15:19:14.179Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/introduction - 2026-03-09T15:19:14.179Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/security-and-best-practices/prompt-injection - 2026-03-09T15:19:14.179Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/storage - 2026-03-09T15:19:14.179Z + 2026-06-11T08:56:09.951Z + weekly + 0.8 + + + https://docs.genlayer.com/developers/intelligent-contracts/testing + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tooling-setup - 2026-03-09T15:19:14.179Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-cli - 2026-03-09T15:19:14.179Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio/advanced-features/custom-plugins - 2026-03-09T15:19:14.180Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio/contract-state - 2026-03-09T15:19:14.180Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio/deploying-contract - 2026-03-09T15:19:14.180Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio/development-tips - 2026-03-09T15:19:14.180Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio/execute-transaction - 2026-03-09T15:19:14.180Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio/limitations - 2026-03-09T15:19:14.180Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio/loading-contract - 2026-03-09T15:19:14.180Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio/monitoring-node-logs - 2026-03-09T15:19:14.180Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio/providers - 2026-03-09T15:19:14.180Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio/reset-the-studio - 2026-03-09T15:19:14.180Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio/troubleshooting - 2026-03-09T15:19:14.180Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio/validators - 2026-03-09T15:19:14.180Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio - 2026-03-09T15:19:14.179Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/types/address - 2026-03-09T15:19:14.180Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/types/collections - 2026-03-09T15:19:14.180Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/types/dataclasses - 2026-03-09T15:19:14.181Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/types/primitive - 2026-03-09T15:19:14.181Z + 2026-06-11T08:56:09.951Z + weekly + 0.8 + + + https://docs.genlayer.com/developers/intelligent-contracts/when-to-use-genlayer + 2026-06-11T08:56:09.951Z + weekly + 0.8 + + + https://docs.genlayer.com/developers/networks + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers/staking-guide - 2026-03-09T15:19:14.181Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/developers - 2026-03-09T15:19:14.175Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/ - 2026-03-09T15:19:14.181Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/partners/chutes - 2026-03-09T16:04:56.383Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/partners/comput3 - 2026-03-09T15:19:14.181Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/partners/genlayerlabs - 2026-03-09T15:19:14.181Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/partners/heurist - 2026-03-09T15:19:14.181Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/partners/ionet - 2026-03-09T15:19:14.181Z + 2026-06-11T08:56:09.951Z + weekly + 0.8 + + + https://docs.genlayer.com/partners/libertai + 2026-06-11T08:56:09.951Z + weekly + 0.8 + + + https://docs.genlayer.com/partners/morpheus + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/accounts-and-addresses - 2026-03-09T15:19:14.182Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/economic-model - 2026-03-09T15:19:14.182Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/genvm - 2026-03-09T15:19:14.182Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/large-language-model-llm-integration - 2026-03-09T15:19:14.182Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/non-deterministic-operations-handling - 2026-03-09T15:19:14.182Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/optimistic-democracy/appeal-process - 2026-03-09T15:19:14.182Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/optimistic-democracy/equivalence-principle - 2026-03-09T15:19:14.182Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/optimistic-democracy/finality - 2026-03-09T15:19:14.182Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/optimistic-democracy/slashing - 2026-03-09T15:19:14.182Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/optimistic-democracy/staking - 2026-03-09T15:19:14.183Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/optimistic-democracy/unstaking - 2026-03-09T15:19:14.183Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/optimistic-democracy - 2026-03-09T15:19:14.182Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/rollup-integration - 2026-03-09T15:19:14.183Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/transactions/transaction-encoding-serialization-and-signing - 2026-03-09T15:19:14.183Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/transactions/transaction-execution - 2026-03-09T15:19:14.183Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/transactions/transaction-statuses - 2026-03-09T15:19:14.183Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/transactions/types-of-transactions - 2026-03-09T15:19:14.183Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/transactions - 2026-03-09T15:19:14.183Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/validators-and-validator-roles - 2026-03-09T15:19:14.183Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/web-data-access - 2026-03-09T15:19:14.183Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts - 2026-03-09T15:19:14.182Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/optimistic-democracy-how-genlayer-works - 2026-03-09T15:19:14.183Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/typical-use-cases - 2026-03-09T15:19:14.183Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/what-are-intelligent-contracts - 2026-03-09T15:19:14.183Z + 2026-06-11T08:56:09.951Z + weekly + 0.8 + + + https://docs.genlayer.com/understand-genlayer-protocol/what-is-genlayer + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/what-makes-genlayer-different - 2026-03-09T15:19:14.184Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/who-is-genlayer-for - 2026-03-09T15:19:14.184Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/why-we-are-building-genlayer - 2026-03-09T15:19:14.184Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol - 2026-03-09T15:19:14.181Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/validators/changelog - 2026-03-09T16:05:26.719Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/validators/genvm-configuration - 2026-03-09T16:05:04.111Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/validators/monitoring - 2026-03-09T15:19:14.184Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/validators/setup-guide - 2026-03-09T16:05:27.399Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/validators/system-requirements - 2026-03-09T15:19:14.184Z + 2026-06-11T08:56:09.951Z weekly 0.8 https://docs.genlayer.com/validators/upgrade - 2026-03-09T15:19:14.184Z + 2026-06-11T08:56:09.951Z weekly 0.8 diff --git a/scripts/generate-full-docs.js b/scripts/generate-full-docs.js index 2fc30eed7..74c462827 100644 --- a/scripts/generate-full-docs.js +++ b/scripts/generate-full-docs.js @@ -1,6 +1,8 @@ const fs = require('fs'); const path = require('path'); +const DOMAIN = 'https://docs.genlayer.com'; + // Function to read and parse _meta.json files function parseMetaJson(dir) { const metaFilePath = path.join(dir, '_meta.json'); @@ -11,50 +13,228 @@ function parseMetaJson(dir) { return null; } -// Function to recursively get all MDX files -function getMdxFiles(baseDir, fileList = []) { +function titleFromFilename(filename) { + return filename + .replace(/\.mdx?$/, '') + .split('-') + .map(word => word.charAt(0).toUpperCase() + word.slice(1)) + .join(' '); +} + +// Collect all documentation pages (.mdx and .md), following _meta.json order +// first, then sweeping up any files/directories not listed in _meta.json so +// pages are never silently dropped (e.g. the CLI command subtrees and the +// generated .md API references). +function collectPages(baseDir) { + const pages = []; + const visitedFiles = new Set(); + const visitedDirs = new Set(); + + function visitFile(filePath, title) { + if (visitedFiles.has(filePath)) return; + visitedFiles.add(filePath); + pages.push({ filePath, title }); + } + function traverseDirectory(dir) { - const meta = parseMetaJson(dir); - if (meta) { - Object.keys(meta).forEach(key => { - const mdxPath = path.join(dir, `${key}.mdx`); - if (fs.existsSync(mdxPath)) { - fileList.push(mdxPath); - } + if (visitedDirs.has(dir)) return; + visitedDirs.add(dir); - const subDir = path.join(dir, key); - if (fs.existsSync(subDir) && fs.statSync(subDir).isDirectory()) { - traverseDirectory(subDir); + const meta = parseMetaJson(dir) || {}; + + for (const key of Object.keys(meta)) { + if (key.startsWith('_')) continue; + const value = meta[key]; + if (value && typeof value === 'object' && value.href) continue; // external link + if (value && typeof value === 'object' && value.type === 'separator' && !value.title) continue; + const title = + typeof value === 'string' ? value : (value && value.title) || titleFromFilename(key); + + for (const ext of ['.mdx', '.md']) { + const filePath = path.join(dir, key + ext); + if (fs.existsSync(filePath)) { + visitFile(filePath, title); + break; } - }); + } + + const subDir = path.join(dir, key); + if (fs.existsSync(subDir) && fs.statSync(subDir).isDirectory()) { + traverseDirectory(subDir); + } + } + + // Sweep: pick up anything not referenced by _meta.json + for (const entry of fs.readdirSync(dir).sort()) { + if (entry.startsWith('_') || entry.startsWith('.')) continue; + const fullPath = path.join(dir, entry); + const stat = fs.statSync(fullPath); + if (stat.isDirectory()) { + traverseDirectory(fullPath); + } else if (/\.mdx?$/.test(entry)) { + visitFile(fullPath, titleFromFilename(entry)); + } } } traverseDirectory(baseDir); - return fileList; + return pages; +} + +function urlForPage(filePath, pagesDir) { + let route = path + .relative(pagesDir, filePath) + .replace(/\.mdx?$/, '') + .split(path.sep) + .join('/'); + route = route.replace(/(^|\/)index$/, '$1').replace(/\/$/, ''); + return route ? `${DOMAIN}/${route}` : DOMAIN; +} + +function parseAttributes(attrString) { + const attrs = {}; + const attrRegex = /(\w+)=(?:"([^"]*)"|'([^']*)'|\{`([^`]*)`\}|\{"([^"]*)"\}|\{'([^']*)'\})/g; + let match; + while ((match = attrRegex.exec(attrString)) !== null) { + attrs[match[1]] = match[2] ?? match[3] ?? match[4] ?? match[5] ?? match[6] ?? ''; + } + return attrs; +} + +const CALLOUT_LABELS = { + info: 'Note', + warning: 'Warning', + error: 'Caution', + tip: 'Tip', +}; + +// Block-level components that can legitimately wrap fenced code blocks β€” +// transform these across the whole document before fence-splitting. +function transformBlockJsx(text) { + // ... -> blockquote + text = text.replace(/]*)>([\s\S]*?)<\/Callout>/g, (_, attrString, inner) => { + const attrs = parseAttributes(attrString); + const label = CALLOUT_LABELS[attrs.type] || 'Note'; + const lines = inner.trim().split('\n'); + const quoted = lines.map(line => `> ${line.replace(/^ /, '')}`.trimEnd()).join('\n'); + return `> **${label}:**\n${quoted}`; + }); + + // ... -> labeled sections + text = text.replace( + /([\s\S]*?)<\/Tabs>/g, + (_, itemsString, body) => { + const items = [...itemsString.matchAll(/['"]([^'"]+)['"]/g)].map(m => m[1]); + let index = 0; + const sections = []; + body.replace(/([\s\S]*?)<\/Tabs\.Tab>/g, (__, tabContent) => { + const label = items[index] || `Option ${index + 1}`; + index += 1; + const lines = tabContent.replace(/^\n+|\s+$/g, '').split('\n'); + const indents = lines + .filter(line => line.trim()) + .map(line => line.match(/^ */)[0].length); + const commonIndent = indents.length ? Math.min(...indents) : 0; + const dedented = lines.map(line => line.slice(commonIndent)).join('\n'); + sections.push(`**${label}:**\n\n${dedented}`); + return ''; + }); + return sections.join('\n\n'); + } + ); + + return text; +} + +// Convert MDX/JSX constructs in a non-code text segment to plain markdown +function transformJsxSegment(text) { + // MDX comments + text = text.replace(/\{\/\*[\s\S]*?\*\/\}/g, ''); + + // import/export statements (code samples live inside fences, so this is safe here) + text = text.replace(/^import\s.+$/gm, ''); + text = text.replace(/^export\s+(const|default|let|var)\s.+$/gm, ''); + + // -> markdown link bullet + text = text.replace(/<(?:Custom)?Card\s+([^>]*?)\/?>(?:<\/(?:Custom)?Card>)?/g, (_, attrString) => { + const attrs = parseAttributes(attrString); + if (!attrs.title) return ''; + const link = attrs.href ? `[${attrs.title}](${attrs.href})` : attrs.title; + return attrs.description ? `- ${link}: ${attrs.description}` : `- ${link}`; + }); + text = text.replace(/<\/?Cards[^>]*>/g, ''); + + // ... -> markdown image + text = text.replace(/]*?)\/?>/g, (_, attrString) => { + const attrs = parseAttributes(attrString); + return attrs.src ? `![${attrs.alt || ''}](${attrs.src})` : ''; + }); + + //