diff --git a/.gitignore b/.gitignore index 15e14734..0d8f2c9c 100644 --- a/.gitignore +++ b/.gitignore @@ -28,10 +28,6 @@ yarn-error.log* /generator/expandOpenAPIRef /generator/tsconfig.tsbuildinfo -# LLM documentation (generated) -/public/llms/ -/public/llms.txt - # Sitemap (generated by scripts/generate-sitemap.mjs) /public/sitemap.xml diff --git a/CLAUDE.md b/CLAUDE.md index 9f56986c..eae5f983 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -14,12 +14,11 @@ There is no test suite in this project. Validate changes with `npm run build`. ```bash npm install # Install dependencies -npm run dev # Start dev server (also runs gen:llm, gen:edit-routes, gen:last-updated, gen:sitemap) -npm run build # Production build (also runs gen:llm, gen:edit-routes, gen:last-updated, gen:sitemap) +npm run dev # Start dev server (also runs gen:edit-routes, gen:last-updated, gen:sitemap) +npm run build # Production build (also runs gen:edit-routes, gen:last-updated, gen:sitemap) npm run start # Serve the production build (warns under `output: 'standalone'` — safe to ignore locally; prod runs `node server.js` from `.next/standalone`) npm run lint # ESLint (next/core-web-vitals) on src/ npm run gen # Regenerate API docs from NetBird OpenAPI spec -npm run gen:llm # Regenerate LLM-friendly markdown (auto-runs with dev/build) npm run gen:edit-routes # Regenerate edit-on-GitHub routes (auto-runs with dev/build) npm run gen:last-updated # Regenerate per-page git last-modified dates (auto-runs with dev/build) npm run gen:sitemap # Regenerate public/sitemap.xml (auto-runs with dev/build) @@ -76,10 +75,6 @@ Custom components available in MDX files (see `README.md` for full usage example - `mdx/rehype.mjs` - Rehype plugins (syntax highlighting via Shiki) - `mdx/recma.mjs` - Recma plugins -### LLM Documentation -- `scripts/generate-llm-docs.mjs` generates clean markdown to `public/llms/` (gitignored) -- Runs automatically with `dev` and `build` - ### Generated build data in `src/lib/` Some files in `src/lib/` look hand-written but are generated by `gen:*` scripts and gitignored: - `src/lib/edit-on-github-routes.js` — written by `scripts/generate-github-routes.mjs` diff --git a/package.json b/package.json index 26680301..6a008f44 100644 --- a/package.json +++ b/package.json @@ -3,13 +3,12 @@ "version": "1.0.0", "private": true, "scripts": { - "dev": "npm run gen:llm && npm run gen:edit-routes && npm run gen:last-updated && npm run gen:sitemap && next dev --webpack", - "build": "npm run gen:llm && npm run gen:edit-routes && npm run gen:last-updated && npm run gen:sitemap && next build --webpack", + "dev": "npm run gen:edit-routes && npm run gen:last-updated && npm run gen:sitemap && next dev --webpack", + "build": "npm run gen:edit-routes && npm run gen:last-updated && npm run gen:sitemap && next build --webpack", "gen:edit-routes": "node scripts/generate-github-routes.mjs", "gen:last-updated": "node scripts/generate-last-updated.mjs", "gen:sitemap": "node scripts/generate-sitemap.mjs", "gen": "mkdir -p generator/openapi && curl -L -o generator/openapi/openapi.yml https://raw.githubusercontent.com/netbirdio/netbird/main/shared/management/http/api/openapi.yml && (cd generator && go run .) && npx ts-node generator/index.ts gen --input generator/openapi/expanded.yml --output src/pages/ipa/resources", - "gen:llm": "node scripts/generate-llm-docs.mjs", "start": "next start", "lint": "eslint src/", "lint:mdx": "node scripts/lint-mdx-headings.mjs" diff --git a/scripts/generate-llm-docs.mjs b/scripts/generate-llm-docs.mjs deleted file mode 100644 index 5d13416c..00000000 --- a/scripts/generate-llm-docs.mjs +++ /dev/null @@ -1,238 +0,0 @@ -#!/usr/bin/env node -/** - * LLM Documentation Generator - * - * Generates clean markdown files from MDX pages for LLM indexing. - * Creates: - * - public/llms/*.md - Clean markdown versions of each page - * - public/llms.txt - Index file linking to all pages - */ - -import fs from 'fs'; -import path from 'path'; -import { fileURLToPath } from 'url'; - -const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const ROOT_DIR = path.join(__dirname, '..'); -const PAGES_DIR = path.join(ROOT_DIR, 'src/pages'); -const OUTPUT_DIR = path.join(ROOT_DIR, 'public/llms'); -const LLMS_TXT_PATH = path.join(ROOT_DIR, 'public/llms.txt'); - -// Base URL for the docs site -const BASE_URL = 'https://docs.netbird.io'; - -/** - * Strip JSX/React components from MDX content, keeping clean markdown - */ -function stripJsx(content) { - let result = content; - - // Remove import statements - result = result.replace(/^import\s+.*?[;\n]/gm, ''); - - // Remove export statements (but keep the content if it's a description) - result = result.replace(/^export\s+const\s+description\s*=\s*(['"`])(.+?)\1;?\s*$/gm, ''); - result = result.replace(/^export\s+.*?[;\n]/gm, ''); - - // Remove JSX self-closing tags like ,