From 9dfaaa7e8c6306977207e3edea215e0dda801988 Mon Sep 17 00:00:00 2001 From: Nik Graf Date: Tue, 29 Jul 2025 17:45:48 +0200 Subject: [PATCH] generate llm.txt from the docs --- docs/.gitignore | 3 +++ docs/docusaurus.config.js | 9 +++++++++ docs/package.json | 1 + pnpm-lock.yaml | 22 ++++++++++++++++------ 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/docs/.gitignore b/docs/.gitignore index b2d6de30..3067e0d1 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -4,6 +4,9 @@ # Production /build +# Should be generated on build by the plugin +/static/llms.txt + # Generated files .docusaurus .cache-loader diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 6f83147a..003af0b2 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -46,6 +46,15 @@ const config = { }, ], + plugins: [ + [ + 'docusaurus-plugin-generate-llms-txt', + { + outputFile: 'llms.txt', // defaults to llms.txt if not specified + }, + ], + ], + presets: [ [ 'classic', diff --git a/docs/package.json b/docs/package.json index e2123002..dbcee279 100644 --- a/docs/package.json +++ b/docs/package.json @@ -18,6 +18,7 @@ "@docusaurus/preset-classic": "3.7.0", "@mdx-js/react": "^3.0.0", "clsx": "^2.0.0", + "docusaurus-plugin-generate-llms-txt": "^0.0.1", "prism-react-renderer": "^2.3.0", "react": "^19.0.0", "react-dom": "^19.0.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 40bd7d2c..4905c436 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -406,7 +406,7 @@ importers: version: 7.1.2(graphql@16.11.0) isomorphic-ws: specifier: ^5.0.0 - version: 5.0.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + version: 5.0.0(ws@8.18.2(bufferutil@4.0.9)(utf-8-validate@5.0.10)) lucide-react: specifier: ^0.508.0 version: 0.508.0(react@19.1.0) @@ -767,7 +767,7 @@ importers: specifier: ^4.1.0 version: 4.1.0 effect: - specifier: ^3.17.1 + specifier: ^3.17.0 version: 3.17.1 graphql: specifier: ^16.11.0 @@ -808,6 +808,9 @@ importers: clsx: specifier: ^2.0.0 version: 2.1.1 + docusaurus-plugin-generate-llms-txt: + specifier: ^0.0.1 + version: 0.0.1(@docusaurus/core@3.7.0(@mdx-js/react@3.1.0(@types/react@19.1.8)(react@19.1.0))(acorn@8.15.0)(bufferutil@4.0.9)(eslint@9.31.0(jiti@2.4.2))(lightningcss@1.30.1)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(typescript@5.8.3)(utf-8-validate@5.0.10)) prism-react-renderer: specifier: ^2.3.0 version: 2.4.1(react@19.1.0) @@ -7834,6 +7837,12 @@ packages: resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} engines: {node: '>=0.10.0'} + docusaurus-plugin-generate-llms-txt@0.0.1: + resolution: {integrity: sha512-XlUeQ23anYc85I1k9pO61fWcMWcUs8Tx7n3zqIus/1wjZ1mjezm0lOX9jymu9Y2MAi3/YQbDxsfo4kZrMf5q6A==} + engines: {node: '>=18'} + peerDependencies: + '@docusaurus/core': '>=2.0.0' + dom-accessibility-api@0.5.16: resolution: {integrity: sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==} @@ -23022,6 +23031,11 @@ snapshots: dependencies: esutils: 2.0.3 + docusaurus-plugin-generate-llms-txt@0.0.1(@docusaurus/core@3.7.0(@mdx-js/react@3.1.0(@types/react@19.1.8)(react@19.1.0))(acorn@8.15.0)(bufferutil@4.0.9)(eslint@9.31.0(jiti@2.4.2))(lightningcss@1.30.1)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(typescript@5.8.3)(utf-8-validate@5.0.10)): + dependencies: + '@docusaurus/core': 3.7.0(@mdx-js/react@3.1.0(@types/react@19.1.8)(react@19.1.0))(acorn@8.15.0)(bufferutil@4.0.9)(eslint@9.31.0(jiti@2.4.2))(lightningcss@1.30.1)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(typescript@5.8.3)(utf-8-validate@5.0.10) + js-yaml: 4.1.0 + dom-accessibility-api@0.5.16: {} dom-accessibility-api@0.6.3: {} @@ -25008,10 +25022,6 @@ snapshots: dependencies: ws: 7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10) - isomorphic-ws@5.0.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10)): - dependencies: - ws: 8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) - isomorphic-ws@5.0.0(ws@8.18.2(bufferutil@4.0.9)(utf-8-validate@5.0.10)): dependencies: ws: 8.18.2(bufferutil@4.0.9)(utf-8-validate@5.0.10)