Skip to content

Commit 0f4b432

Browse files
committed
DOC-3471, DOC-3476: Output Markdown endpoints from LLM file generator and add Context7 MCP instructions
Add toMarkdownEndpoints() to generate-llm-files.js so generated llms.txt and llms-full.txt URLs point to index.md Markdown endpoints instead of trailing-slash HTML pages. Add Context7 MCP setup section to llms.txt with Cursor and Claude Code configuration instructions for live documentation lookups.
1 parent 1b6f06b commit 0f4b432

2 files changed

Lines changed: 41 additions & 2 deletions

File tree

-scripts/generate-llm-files.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@ const BASE_URL = 'https://www.tiny.cloud/docs/tinymce/latest';
1919
const DOCS_ROOT_URL = 'https://www.tiny.cloud/docs';
2020
const OUTPUT_DIR = path.join(__dirname, '../modules/ROOT/attachments');
2121

22+
// Convert a trailing-slash doc URL to its Markdown endpoint.
23+
// e.g. https://www.tiny.cloud/docs/tinymce/latest/basic-setup/
24+
// -> https://www.tiny.cloud/docs/tinymce/latest/basic-setup/index.md
25+
// Rewrite doc page URLs from trailing-slash to index.md Markdown endpoints.
26+
// Only affects URLs under /docs/tinymce/; CDN and file URLs are unchanged.
27+
function toMarkdownEndpoints(content) {
28+
return content.replace(
29+
/https:\/\/www\.tiny\.cloud\/docs\/tinymce\/[^\s)"]+/g,
30+
(match) => match.endsWith('/') ? match + 'index.md' : match
31+
);
32+
}
33+
2234
// Fetch sitemap from URL or file
2335
async function getSitemap(source) {
2436
if (source.startsWith('http://') || source.startsWith('https://')) {
@@ -1225,11 +1237,11 @@ async function main() {
12251237
const urls = parseSitemap(sitemapContent);
12261238
console.log(`Found ${urls.length} unique URLs in sitemap`);
12271239

1228-
const llmsTxt = generateLLMsTxt(urls);
1240+
const llmsTxt = toMarkdownEndpoints(generateLLMsTxt(urls));
12291241
fs.writeFileSync(path.join(OUTPUT_DIR, 'llms.txt'), llmsTxt);
12301242
console.log('✓ Generated llms.txt');
12311243

1232-
const llmsFullTxt = await generateLLMsFullTxt(urls);
1244+
const llmsFullTxt = toMarkdownEndpoints(await generateLLMsFullTxt(urls));
12331245
fs.writeFileSync(path.join(OUTPUT_DIR, 'llms-full.txt'), llmsFullTxt);
12341246
console.log('✓ Generated llms-full.txt');
12351247

modules/ROOT/attachments/llms.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,33 @@ TinyMCE AI (`tinymceai` plugin) is the current AI writing assistant for TinyMCE.
117117
- [Upgrading TinyMCE](https://www.tiny.cloud/docs/tinymce/latest/upgrading/): Upgrade guide
118118
- [Migration from 7.x](https://www.tiny.cloud/docs/tinymce/latest/migration-from-7x/): Migrate from TinyMCE 7
119119

120+
## AI-Assisted Development with MCP
121+
122+
For up-to-date TinyMCE documentation directly in AI coding tools, set up the Context7 MCP server. TinyMCE docs are indexed at [context7.com/tinymce/tinymce-docs](https://context7.com/tinymce/tinymce-docs).
123+
124+
### Cursor
125+
126+
Add to `.cursor/mcp.json`:
127+
128+
```json
129+
{
130+
"mcpServers": {
131+
"context7": {
132+
"command": "npx",
133+
"args": ["-y", "@upstash/context7-mcp"]
134+
}
135+
}
136+
}
137+
```
138+
139+
### Claude Code
140+
141+
```bash
142+
claude mcp add context7 -- npx -y @upstash/context7-mcp
143+
```
144+
145+
Add "use context7" to any prompt for live TinyMCE documentation lookups.
146+
120147
## Complete Documentation
121148

122149
For a complete list of all 411 documentation pages, see [llms-full.txt](https://www.tiny.cloud/docs/llms-full.txt).

0 commit comments

Comments
 (0)