Skip to content

Commit 169c7b8

Browse files
committed
Update README with info about the llms script
1 parent 77cea57 commit 169c7b8

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,14 @@ Replicated supports the [llms.txt](https://llmstxt.org/) convention for making d
7979

8080
- [llms.txt](https://docs.replicated.com/llms.txt): This file contains Markdown versions of key docs pages.
8181
- [llms-full.txt](https://docs.replicated.com/llms-full.txt): This file contains the contents of the docs/ directory in the [replicated-docs](https://github.com/replicatedhq/replicated-docs) repository.
82+
83+
### How LLM Files Are Generated
84+
85+
The `static/js/generate-llms.js` script generates LLM files and plain Markdown versions of documentation pages:
86+
- `static/llms.txt`: Curated list of key documentation pages
87+
- `static/llms-full.txt`: Complete archive of all documentation
88+
- Plain `.md` files in `static/vendor/`, `static/enterprise/`, `static/reference/`, and `static/release-notes/`
89+
90+
This script runs automatically with the `prebuild` npm hook before every production build. The `prebuild` hook is defined in `package.json`. To ensure the `prebuild` npm hook runs, the Netlify build command must be `npm run build` (not `docusaurus build`).
91+
92+
Generated files are excluded from version control (listed in `.gitignore`) because they are created fresh on every build.

static/js/generate-llms.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
/**
2+
* LLM Documentation Generator
3+
*
4+
* This script generates LLM-accessible documentation files by processing all markdown
5+
* files in the docs/ directory. It runs automatically via the prebuild npm hook.
6+
*
7+
* Generated files (NOT tracked in git):
8+
* - static/llms.txt - Curated list of key documentation pages
9+
* - static/llms-full.txt - Complete archive of all documentation
10+
* - static/vendor/*.md - Plain markdown copies of vendor docs
11+
* - static/enterprise/*.md - Plain markdown copies of enterprise docs
12+
* - static/reference/*.md - Plain markdown copies of reference docs
13+
* - static/release-notes/*.md - Plain markdown copies of release notes
14+
*
15+
* Requirements:
16+
* - Must be run via `npm run build` (or `npm run generate-llms`) to execute
17+
* - Netlify build command MUST be `npm run build`, not `docusaurus build` directly
18+
* - Generated files are excluded from git via .gitignore
19+
*/
20+
121
const fs = require('fs');
222
const path = require('path');
323

0 commit comments

Comments
 (0)