Skip to content

[docs-infra] Create llms.txt #1738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 42 commits into
base: master
Choose a base branch
from
Draft

[docs-infra] Create llms.txt #1738

wants to merge 42 commits into from

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Apr 17, 2025

  • render react docs to markdown
  • serve under /<react-docs-path>.md. e.g. for /react/components/accordion add /react/components/accordion.md
  • add a /llms.txt
  • add a link to the markdown version on each page (I guess this is temporary, we can replace with "Ask AI" dorpdown?)
    Screenshot 2025-05-05 at 20 23 47
  • currently the markdown is generated on the fly, right when the docs are built. We could also opt for pregenerating them and check them in our repo, this would stronger guarantee correctness in the absence of tests.

How does the mdx to md transformation currently work:

  • parse mdx files into mdx ast
  • statically analyze the jsx parts and render reference tables and demos, extract out the description and title
  • convert those demos and reference tables jsx AST into md AST.
  • error on unrecognized jsx
  • run the mdast stringify plugin to obtain markdown

Drawbacks

  • It only statically analyzes the JSX, this restricts a lot the valid jsx we are able to write
  • Introducing new syntax and jsx elements will be cumbersome

Alternatives that are more maintainable:

Will likely move to one of those methods as to not disrupt the velocity of the project

Copy link

netlify bot commented Apr 17, 2025

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 0053de9
🔍 Latest deploy log https://app.netlify.com/sites/base-ui/deploys/6819d5c1f8483a0008345624
😎 Deploy Preview https://deploy-preview-1738--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Apr 24, 2025
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label May 5, 2025
Copy link

pkg-pr-new bot commented May 5, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@base-ui-components/react@1738

commit: 0053de9

@Janpot Janpot changed the title [docs-infra] Create llms.txt (WIP) [docs-infra] Create llms.txt May 6, 2025
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label May 19, 2025
@michaldudak michaldudak added docs Improvements or additions to the documentation scope: infra Infrastructure work going on behind the scenes and removed scope: docs-infra labels May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation PR: out-of-date The pull request has merge conflicts and can't be merged scope: infra Infrastructure work going on behind the scenes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants