Skip to content

feat(llms-txt): generate llms.txt and per-page markdown at build time - #4743

Open
ShaneK wants to merge 5 commits into
mainfrom
FW-7589
Open

ShaneK wants to merge 5 commits into
mainfrom
FW-7589

Conversation

@ShaneK

@ShaneK ShaneK commented Sep 18, 2026

Copy link
Copy Markdown
Member

Issue URL: internal

What is the current behavior?

Currently, an agent reading the docs parses rendered HTML, which on a component page means digging prop tables out of <table> markup and missing the playground examples entirely, since those mount on the client. This isn't ideal and can make it more difficult than necessary for LLMs to understand how to use Ionic Framework components.

What is the new behavior?

A new postBuild plugin writes /docs/llms.txt in the llmstxt.org format, 305 links grouped by the current version's sidebar categories, with api, cli and native under the spec's ## Optional heading. It also writes 608 markdown twins, one per sidebar-reachable page in both built versions, so /docs/api/button is also readable at /docs/api/button.md, which helps LLMs parse and understand things easier than HTML.

Additionally, we added an alternate link to doc pages that links to the md pages, helping with discoverability.

Does this introduce a breaking change?

  • Yes
  • No

Other information

@ShaneK
ShaneK requested a review from a team as a code owner September 18, 2026 19:01
@vercel

vercel Bot commented Sep 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ionic-docs Ready Ready Preview Sep 22, 2026 8:42pm UTC

Request Review

@ShaneK ShaneK changed the title feat(llms-txt): generate llms.txt and per-page markdown twins at buil… feat(llms-txt): generate llms.txt and per-page markdown at build time Sep 18, 2026

@thetaPC thetaPC left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, left some non-blocking requests/questions.

Comment thread vercel.json
"headers": [
{
"source": "/(.*).md",
"headers": [{ "key": "Content-Disposition", "value": "inline" }]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my own curiosity: what's this do?

@ShaneK ShaneK Sep 22, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tries to stop some models from downloading the file and instead read it inline, it deals with a weird edge case I encountered

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be beneficial to document that edge case. Maybe in the plugin's Readme.

Comment thread plugins/docusaurus-plugin-llms-txt/README.md
Comment thread plugins/docusaurus-plugin-llms-txt/README.md Outdated
Comment thread src/theme/DocItem/Layout/index.tsx Outdated
Comment thread plugins/docusaurus-plugin-llms-txt/README.md

@thetaPC thetaPC left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, left one suggestion

This branch was successfully deployed

1 active deployment
Preview 9ced3cde Deployed Sep 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants