Skip to content

Commit db04cde

Browse files
authored
chore: remove llm cleaner (#208)
* chore: remove llm cleaner * Update index.mjs * fixup!
1 parent 2966726 commit db04cde

1 file changed

Lines changed: 1 addition & 16 deletions

File tree

‎scripts/html/index.mjs‎

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,10 @@
11
import { execFile } from 'node:child_process';
2-
import { cp, readFile, writeFile } from 'node:fs/promises';
2+
import { cp, readFile } from 'node:fs/promises';
33
import { statSync } from 'node:fs';
44
import { promisify } from 'node:util';
55

66
const execFileAsync = promisify(execFile);
77

8-
// TODO: Have doc-kit understand that some pages don't have meaningful information
9-
// The llms-txt generator lists every page with a depth-1 heading. JSX-driven
10-
// pages like the homepage produce entries with no title or description — drop
11-
// them, they carry no information for LLMs.
12-
const cleanLlmsTxt = async path => {
13-
const content = await readFile(path, 'utf8');
14-
const cleaned = content
15-
.split('\n')
16-
.filter(line => !line.startsWith('- []('))
17-
.join('\n');
18-
await writeFile(path, cleaned);
19-
};
20-
218
const runDocKit = version =>
229
execFileAsync(
2310
'npx',
@@ -50,10 +37,8 @@ const versions = JSON.parse(await readFile('./versions.json'));
5037

5138
for (const version of versions) {
5239
await runDocKit(version);
53-
await cleanLlmsTxt(`./out/docs/api/v${version.match(/\d+/)[0]}.x/llms.txt`);
5440
}
5541
await runDocKit();
56-
await cleanLlmsTxt('./out/llms.txt');
5742

5843
// Publish the markdown sources next to the rendered pages so the llms.txt
5944
// links (`{path}.md`) resolve to LLM-friendly raw markdown.

0 commit comments

Comments
 (0)