feat: add llms.txt and LLM-friendly markdown docs generation#497
feat: add llms.txt and LLM-friendly markdown docs generation#497plainheart merged 5 commits intoapache:masterfrom
Conversation
|
Just a gentle follow-up on this PR. |
|
Hi @plainheart , sorry for the ping. |
There was a problem hiding this comment.
Pull request overview
Adds an LLM-friendly, static Markdown documentation output to the ECharts doc build, including per-language llms.txt indexes and Markdown conversions of the existing documents/*-parts/*.json content.
Changes:
- Add
build/build-llms.jsto convert built part JSON (HTML descriptions) into Markdown and generate per-languagellms.txt. - Integrate the new Markdown generation step into
build/build-doc.jsafter the main doc build. - Add
turndown+turndown-plugin-gfmdev dependencies and ignore generatedpublic/*/llms*outputs.
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Adds Turndown dependencies for HTML→Markdown conversion. |
| package-lock.json | Locks new Turndown-related transitive dependencies. |
| build/build-llms.js | New converter/generator for llms-documents Markdown + llms.txt indexes. |
| build/build-doc.js | Runs LLM-doc generation as part of the standard doc build (non-watch mode). |
| .gitignore | Ignores generated public/{en,zh}/llms.txt and llms-documents/. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 5 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Addressed all feedback from the Copilot review. See individual replies on each comment for details. |
|
@takaebato Thanks for working on the LLM docs! The current tutorial parts have been outdated and replaced by the echarts-handbook repo. Can you help generate the tutorial documents with that repo? I'm going to merge this PR first. |
|
Thanks for merging! |
Summary
Add llms.txt and LLM-friendly markdown documentation generation to the ECharts doc build pipeline. Since the current SPA-based docs are difficult for AI agents to access via web fetch, this provides static Markdown alternatives.
build/build-llms.jsthat mechanically convertsdocuments/*-parts/*.jsontollms-documents/*-parts/*.mdby converting HTML descriptions to Markdown via turndown, with type/default info extracted from full schema JSONs (option.json, api.json, etc.)build/build-doc.js(runs after main doc build)llms.txtindex file per language (en/zh) listing all available documentationturndownandturndown-plugin-gfmas dependenciesOutput structure
Output examples
en/llms.txt
llms-documents/option-parts/option.title.md (excerpt)
Link resolution
Internal links in HTML (
href="#property.path"andhref="(option|api|tutorial).html#...") are resolved to relative .md file paths before turndown conversion on a best-effort basis.Out of ~22,600 total links in the source, ~12,000 internal links are resolved to .md file paths (~99%), ~10,600 external links are preserved as-is, and ~50 links with non-standard formats (e.g. missing
#prefix) are left unresolved.