feat(docs): generate llms.txt and llms-full.txt#6430
feat(docs): generate llms.txt and llms-full.txt#6430okineadev wants to merge 3 commits intomermaid-js:developfrom
llms.txt and llms-full.txt#6430Conversation
|
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
commit: |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
This is the recommended spelling and usage from the [vitepress-plugin-llms][1] package. [1]: https://www.npmjs.com/package/vitepress-plugin-llms
There was a problem hiding this comment.
I love the idea of adding llms.txt and llms-full.txt to our docs site! I think it would make AIs so much smarter when working with Mermaid!
But I am a bit worried about using a new library that doesn't have many users, and as a widely uses open-source project, we're a bit sensitive to supply-chain attacks.
Since you're the author of this lib, and you already seem to be doing all the good security practices (e.g. signed provenance statements on NPM), that's good to hear!
It will help to replace tsup with plain old typescript, so that the dist/index.js file is easier to manually review when you make updates (and for such a small lib, minifying it won't reduce package sizes by much)!
I am also a bit worried about the markdown-title dependency, since it has pretty much no downloads except for vite-plugin-llms and was last updated 6 years ago. Could we maybe replace it with @mdit-vue/plugin-title, which is what Vitepress uses?
I wonder if it makes sense to remove gray-matter too and replace it with what Vitepress uses, see https://github.com/vuejs/vitepress/blob/35f36a96bb1cb34f7b2e1f1f3b26d26a9038ef8a/src/node/markdown/markdown.ts#L5-L8, just to make sure parsing is consistent with Vitepress.
It looks like you could even do import { createMarkdownRenderer } from 'vitepress' and const md = await createMarkdownRenderer(); to use the exact markdown parser that Vitepress uses too!
Edit: I fixed the ESLint issues too, so hopefully this PR gets a ✔️
|
I'm minifying anyway |
|
I also won't replace tsup with typescript, tsup is very good |
Just yesterday I figured out how to process markdown, I thought my project was finally finished (since almost everything is ready), but now I seem to understand that I will have to rewrite the entire mechanism |
|
I just tried switching to |
|
Hey folks, wondering if there's any movement, or whether help is needed. Also, releasing even static snapshot of llms.txt would be very useful. |
Currently, there are plans to integrate this functionality into VitePress (vuejs/vitepress#4590), there is even a PR - vuejs/vitepress#4692 But so far everything is slow and no one is in a hurry, the VitePress maintainer said that my plugin is a good enough solution for now (see vuejs/vitepress#4545 (comment)) Moreover, now a lot of popular websites use Evan You even mentioned the plugin - https://x.com/youyuxi/status/1918134176261521827 So I think there's no point in pulling the cat by the tail, we can just add the plugin now and that's it. |
📑 Summary
This PR adds the
vitepress-plugin-llmsplugin to the VitePress configuration, which automatically generates LLM-Friendly documentation for the websiteIt generates
llms.txt,llms-full.txtand an LLM-Friendly version of each page in.mdformatSee https://llmstxt.org
MERMAID_RELEASE_VERSIONis used for all new features.pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.If you accept this PR - I suggest you post a news story on your X that the site https://mermaid.js.org/ now has documentation for LLMs and mention my plugin and me (@okineadev)