8000 fix: fix `llms.txt` generation by okineadev · Pull Request #940 · vue-macros/vue-macros · GitHub
[go: up one dir, main page]

Skip to content
8000

fix: fix llms.txt generation #940

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

Merged
merged 2 commits into from
Mar 25, 2025
Merged

fix: fix llms.txt generation #940

merged 2 commits into from
Mar 25, 2025

Conversation

okineadev
Copy link
Contributor

Description

Thanks for using my plugin 🤝

But I noticed a problem in the commit d25754e

@sxzz you added the plugin to the Vite configuration, but it needs to be added to the VitePress configuration (.vitepress/config/index.ts) for it to work correctly

I excluded the Chinese version of the documentation for LLMs (and why have LLM documentation in two languages ​​if you can leave only English?) and some extra files

Now the documentation is generated correctly and only in English

Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
vercel bot commented Mar 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
vue-macros ✅ Ready (Inspect) Visit Preview Mar 24, 2025 7:30pm

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Mar 24, 2025
Copy link
pkg-pr-new bot commented Mar 24, 2025

Open in Stackblitz

@vue-macros/api

npm i https://pkg.pr.new/@vue-macros/api@940

@vue-macros/astro

npm i https://pkg.pr.new/@vue-macros/astro@940

@vue-macros/boolean-prop

npm i https://pkg.pr.new/@vue-macros/boolean-prop@940

@vue-macros/better-define

npm i https://pkg.pr.new/@vue-macros/better-define@940

@vue-macros/chain-call

npm i https://pkg.pr.new/@vue-macros/chain-call@940

@vue-macros/common

npm i https://pkg.pr.new/@vue-macros/common@940

@vue-macros/config

npm i https://pkg.pr.new/@vue-macros/config@940

@vue-macros/define-emit

npm i https://pkg.pr.new/@vue-macros/define-emit@940

@vue-macros/define-models

npm i https://pkg.pr.new/@vue-macros/define-models@940

@vue-macros/define-prop

npm i https://pkg.pr.new/@vue-macros/define-prop@940

@vue-macros/define-props

npm i https://pkg.pr.new/@vue-macros/define-props@940

unplugin-vue-define-options

npm i https://pkg.pr.new/unplugin-vue-define-options@940

@vue-macros/define-props-refs

npm i https://pkg.pr.new/@vue-macros/define-props-refs@940

@vue-macros/define-render

npm i https://pkg.pr.new/@vue-macros/define-render@940

@vue-macros/define-slots

npm i https://pkg.pr.new/@vue-macros/define-slots@940

@vue-macros/define-stylex

npm i https://pkg.pr.new/@vue-macros/define-stylex@940

@vue-macros/devtools

npm i https://pkg.pr.new/@vue-macros/devtools@940

@vue-macros/eslint-config

npm i https://pkg.pr.new/@vue-macros/eslint-config@940

@vue-macros/export-expose

npm i https://pkg.pr.new/@vue-macros/export-expose@940

@vue-macros/export-props

npm i https://pkg.pr.new/@vue-macros/export-props@940

@vue-macros/export-render

npm i https://pkg.pr.new/@vue-macros/export-render@940

@vue-macros/hoist-static

npm i https://pkg.pr.new/@vue-macros/hoist-static@940

@vue-macros/jsx-directive

npm i https://pkg.pr.new/@vue-macros/jsx-directive@940

vue-macros

npm i https://pkg.pr.new/vue-macros@940

@vue-macros/named-template

npm i https://pkg.pr.new/@vue-macros/named-template@940

@vue-macros/nuxt

npm i https://pkg.pr.new/@vue-macros/nuxt@940

@vue-macros/reactivity-transform

npm i https://pkg.pr.new/@vue-macros/reactivity-transform@940

@vue-macros/script-lang

npm i https://pkg.pr.new/@vue-macros/script-lang@940

@vue-macros/setup-block

npm i https://pkg.pr.new/@vue-macros/setup-block@940

@vue-macros/setup-component

npm i https://pkg.pr.new/@vue-macros/setup-component@940

@vue-macros/setup-sfc

npm i https://pkg.pr.new/@vue-macros/setup-sfc@940

@vue-macros/short-bind

npm i https://pkg.pr.new/@vue-macros/short-bind@940

@vue-macros/short-emits

npm i https://pkg.pr.new/@vue-macros/short-emits@940

@vue-macros/short-vmodel

npm i https://pkg.pr.new/@vue-macros/short-vmodel@940

@vue-macros/test-utils

npm i https://pkg.pr.new/@vue-macros/test-utils@940

@vue-macros/volar

npm i https://pkg.pr.new/@vue-macros/volar@940

commit: 76f08cc

@dosubot dosubot bot added the documentation Improvements or additions to documentation label Mar 24, 2025
@sxzz
Copy link
Member
sxzz commented Mar 24, 2025

Could you specify which part isn’t functioning as expected?

https://vitepress.dev/reference/site-config#vite The vite.config.ts file should ultimately be loaded by Vite and merged with VitePress's configuration.

@okineadev
Copy link
Contributor Author

Could you specify which part isn’t functioning as expected?

vitepress.dev/reference/site-config#vite The vite.config.ts file should ultimately be loaded by Vite and merged with VitePress's configuration.

Now there is one problem - if you do not include index.md in ignoreFiles - then llms.txt will not be generated correctly

It should be like this:

# Vue Macros

> Explore more macros and syntax sugar to Vue.

## Table of Contents

Now it looks like this if you do not exclude index.md:

# LLMs Documentation

This file contains links to all documentation sections.

## Table of Contents

This PR does not have this problem.

Regarding the plugin in the Vite configura 8000 tion - we can try to roll it back and see how it goes

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Mar 24, 2025
@okineadev
Copy link
Contributor Author

Could you specify which part isn’t functioning as expected?

vitepress.dev/reference/site-config#vite The vite.config.ts file should ultimately be loaded by Vite and merged with VitePress's configuration.

Done

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 25, 2025
@sxzz sxzz merged commit e9d2b1c into vue-macros:main Mar 25, 2025
10 checks passed
@okineadev
< 8000 span class="Button-content"> Copy link
Contributor Author

yay!

@okineadev okineadev deleted the fix-llmstxt branch March 25, 2025 05:14
okineadev added a commit to okineadev/vitepress-plugin-llms that referenced this pull request Mar 25, 2025
… not included in `ignoreFiles`

This error is very strange, I first noticed it here - vue-macros/vue-macros#940 (comment)

I could not understand at all what the problem was and how the `ignoreFiles` option affects reading files at all

After a few minutes of debugging I found that the problem was not in the `ignoreFiles` option, not in reading the file, but in the caching mechanism of the `gray-matter` package (https://npmjs.com/package/gray-matter)

So I added clearing of the `gray-matter` cache before processing the document in `generateLLMsTxt()` and this fixed the bug

I learned about the `matter.clearCache()` option here - jonschlinkert/gray-matter#174
@okineadev
Copy link
Contributor Author

Could you specify which part isn’t functioning as expected?
vitepress.dev/reference/site-config#vite The vite.config.ts file should ultimately be loaded by Vite and merged with VitePress's configuration.

Now there is one problem - if you do not include index.md in ignoreFiles - then llms.txt will not be generated correctly

It should be like this:

# Vue Macros

> Explore more macros and syntax sugar to Vue.

## Table of Contents

Now it looks like this if you do not exclude index.md:

# LLMs Documentation

This file contains links to all documentation sections.

## Table of Contents

This PR does not have this problem.

Note

This bug was fixed in version v0.0.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0