Skip to content

Docs LLM accessibility: add llms.txt, allow copying and viewing pages as markdown#581

Open
aatuvai wants to merge 13 commits intomainfrom
aatuvai/2026-03-10-docs-llm-usage
Open

Docs LLM accessibility: add llms.txt, allow copying and viewing pages as markdown#581
aatuvai wants to merge 13 commits intomainfrom
aatuvai/2026-03-10-docs-llm-usage

Conversation

@aatuvai
Copy link
Contributor

@aatuvai aatuvai commented Mar 10, 2026

The first iteration of features dedicated to providing LLMs better context of the docs site.

New features:

  • Generate a markdown version each docs page (for example /docs/get-started gets a markdown version in /docs/get-started.md)
  • Generate a llms.txt file (available at /docs/llms.txt)
  • Add "Copy for LLM" and "View as markdown" options to the docs page actions:
Screenshot 2026-03-17 at 15 52 13

A new Docusaurus plugin, @signalwire/docusaurus-plugin-llms-txt, is installed for the task of generating the markdown pages and the llms.txt file. The plugin is configured in a new file /server/llms/index.ts.

List of changes:

  • Adds @signalwire/docusaurus-plugin-llms-txt to the list of dependencies in package.json
  • Adds the @signalwire/docusaurus-plugin-llms-txt plugin to the Docusaurus plugins configuration in docusaurus.config.ts
  • Adds a configuration file for the @signalwire/docusaurus-plugin-llms-txt plugin in /server/llms/index.ts
  • Adds 4 rehype plugins to /server/llms/, which are used in the @signalwire/docusaurus-plugin-llms-txt plugin:
    • rehype-process-custom-components.ts: Used to process custom components for cleaner markdown output
    • rehype-remove-heading-anchor-links.ts: Prevents the automatically created heading anchor links from appearing in the markdown output
    • rehype-remove-irrelevant-components.ts: Prevents components not useful for AI to appear in the markdown output
    • rehype-reposition-h1.ts: Ensures the page title is correctly applied to the markdown version of the page
  • Adds unit tests for the rehype plugins.
  • Adds fixtures used in the rehype unit tests /server/fixtures/llms
  • Adjusts the styles of the PageActions component to accommodate the design changes found in Figma
    • As a part of the style changes, adds two new icons.
  • Fixes a type mismatch error with unist, which caused some unit tests to fail (/server/unist-augment.d.ts)

@socket-security
Copy link

socket-security bot commented Mar 10, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​signalwire/​docusaurus-plugin-llms-txt@​2.0.0-alpha.78710010097100

View full report

@github-actions
Copy link

github-actions bot commented Mar 10, 2026

Amplify deployment status

Branch Commit Job ID Status Preview Updated (UTC)
aatuvai/2026-03-10-docs-llm-usage b0de7e0 11 ✅SUCCEED aatuvai-2026-03-10-docs-llm-usage 2026-03-19 13:06:39

@aatuvai aatuvai marked this pull request as ready for review March 17, 2026 15:04
@aatuvai aatuvai requested review from ptgott, rodgtr1 and roraback March 17, 2026 15:04
@aatuvai aatuvai deployed to docs-amplify March 19, 2026 12:57 — with GitHub Actions Active
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.

1 participant