@barodoc/plugin-llms-txt 9.0.0 → 10.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -0
- package/dist/index.js +4 -3
- package/package.json +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# @barodoc/plugin-llms-txt
|
|
2
|
+
|
|
3
|
+
Generate [llms.txt](https://llmstxt.org) and optional `llms-full.txt` at build time so AI assistants and LLMs can consume your documentation as plain text.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @barodoc/plugin-llms-txt
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Config
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"plugins": [
|
|
16
|
+
["@barodoc/plugin-llms-txt", {
|
|
17
|
+
"description": "Documentation for My Project",
|
|
18
|
+
"full": true,
|
|
19
|
+
"links": [
|
|
20
|
+
{ "title": "GitHub", "url": "https://github.com/user/repo" }
|
|
21
|
+
]
|
|
22
|
+
}]
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
- **description** — Site description in the llms.txt header (default: config name).
|
|
28
|
+
- **full** — Generate `llms-full.txt` with full page content (default: `true`).
|
|
29
|
+
- **links** — Extra links to include (e.g. repo, API).
|
|
30
|
+
|
|
31
|
+
## Output
|
|
32
|
+
|
|
33
|
+
Files are written to the **build output root** (e.g. `dist/`), so after deploy you get:
|
|
34
|
+
|
|
35
|
+
- `https://your-docs.com/llms.txt` — Summary (titles, descriptions, links).
|
|
36
|
+
- `https://your-docs.com/llms-full.txt` — Full content (when `full: true`).
|
|
37
|
+
|
|
38
|
+
The plugin does not change `robots.txt`. AI tools and MCP servers can fetch these URLs by convention.
|
|
39
|
+
|
|
40
|
+
## Docs
|
|
41
|
+
|
|
42
|
+
Full guide: [LLMs.txt Plugin](https://barodoc.dev/guides/plugins/llms-txt).
|
package/dist/index.js
CHANGED
|
@@ -51,9 +51,10 @@ function walkMdFiles(dir, base = dir) {
|
|
|
51
51
|
function scanDocs(docsDir, locales, defaultLocale, navigation) {
|
|
52
52
|
const orderedSlugs = [];
|
|
53
53
|
for (const group of navigation) {
|
|
54
|
-
for (const
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
for (const entry of group.pages ?? []) {
|
|
55
|
+
const slugs = typeof entry === "string" ? [entry] : entry.pages;
|
|
56
|
+
for (const slug of slugs) {
|
|
57
|
+
if (!orderedSlugs.includes(slug)) orderedSlugs.push(slug);
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
60
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barodoc/plugin-llms-txt",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.5",
|
|
4
4
|
"description": "Generate llms.txt and llms-full.txt for AI consumption",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"@barodoc/core": "
|
|
18
|
+
"@barodoc/core": "10.0.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/node": "^22.0.0",
|
|
22
22
|
"tsup": "^8.3.0",
|
|
23
23
|
"typescript": "^5.7.0",
|
|
24
|
-
"@barodoc/core": "
|
|
24
|
+
"@barodoc/core": "10.0.0"
|
|
25
25
|
},
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"scripts": {
|