-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat(llm.txt): adds script to compile llm.txt #8093
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
base: master
Are you sure you want to change the base?
Conversation
Does not work:
|
I see what you mean here, definitely tweaking it a bit still. |
@rtivital I've made some changes which should be ready for re-review. I wanted to note this adds a few dependencies:
I'm usually more keen on not adding dependencies whenever possible, let me know if you see a different way I could go about it to reduce this. I did break out two seperate scripts located in
If you take a look at the new I'm not entirely sure if the max-file-size is something you'd want to include here but figured I'd throw it in just incase, I might remove those generated files from this commit though. |
|
26f043f
to
f8f4ba0
Compare
- scripts/llm/compile-llm-doc.ts generates a static LLM.md file - file contains all demo code, prop descriptions, styles api data for each component - scripts/llm/compile-llm-by-size.ts generates sized files seperated by logical concern with filesize max of 256kb - outputs files into a directory ./llm-docs - yarn compile:llm - yarn compile:llm:size
f8f4ba0
to
b68902b
Compare
Thank you @rtivital, I've addressed all your feedback:
Both compile-llm-doc.ts and compile-llm-by-size.ts scripts have been updated with identical fixes. I squashed my commits, sorry for the force pushes I was arm wrestling with git for a minute there. Should be ready for re-review. |
Leftovers:
Content of these components is usually important for understanding the component. It is better to include the content of those in llm.txt. https://github.com/mantinedev/mantine/tree/master/apps/mantine.dev/src/components/MdxProvider/MdxSharedContent |
- Add extraction and rendering of MdxSharedContent components - Preserve original JSX examples (e.g., <Polymorphic />, <GetElementRef />) - Include educational content from AutoContrast, Gradient, InputFeatures, etc. - Handle component-specific props (withVariant, refType, element) - Convert MDX component output to markdown format - Fix escape character issues in JSX rendering
d4d1b5c
to
4d48a9b
Compare
Thanks for your help with this @rtivital! I'm a huge fan of Mantine and glad to be contributing. I believe I've addressed your concerns about the shared content components.
The output now looks like: <Polymorphic defaultElement="button" changeToElement="a" component="ActionIcon" withNext />
## Polymorphic component
ActionIcon is a polymorphic component – its default root element is button, but it can be changed to any other element or component
with component prop:
[... rest of content ...] Hopefully this addresses your comment. Let me know if you'd like any adjustments! |
Looking better already, several other fixes left:
|
Thanks for the feedback @rtivital! Glad we're getting closer. Just to confirm you want all changelog information ignored for the scripts? Chipping away at the rest now as well! |
…size restricted script - compile-llm-by-size isn't incredibly useful, llms can grep as needed, once single script is polished it'll be easier to extract into this feature later
The script now properly handles: - FAQ articles with embedded code blocks (preserving imports) - FAQ articles with separate demo files - Multi-demo files where multiple exports exist in one file - Multi-file demos with code arrays
Howdy @rtivital, I believe I've addressed all your comments. # How to align input with a button in a flex container?
Learn how to align Mantine inputs with buttons using Group component
If you try to align one of Mantine inputs in a flex container with a button,
you will notice that input is not aligned with the button. This happens because
Mantine inputs have associated elements: label, description and error message.
#### Example: AlignInputButton
```tsx
import { Button, Group, TextInput } from '@mantine/core';
function Demo() {
return (
<Group align="flex-end">
<TextInput label="Your email" error="Something went wrong" />
<Button>Submit</Button>
</Group>
);
}
```
To align input with a button, you can either use `inputContainer` prop to wrap the button
next to the in a flex container:
#### Example: AlignInputButtonCorrect
```tsx
import { Button, Group, TextInput } from '@mantine/core';
function Demo() {
return (
<TextInput
label="Your email"
error="Something went wrong"
inputContainer={(children) => (
<Group align="flex-start">
{children}
<Button>Submit</Button>
</Group>
)}
/>
);
}
```
Or change error/description position to absolute with [Styles API](https://mantine.dev/styles/styles-api/):
#### Example: AlignInputButtonStyles
```tsx
import { Button, Group, TextInput } from '@mantine/core';
import classes from './Demo.module.css';
function StylesDemo() {
return (
<Group align="flex-end" pb={18}>
<TextInput label="Your email" error="Something went wrong" classNames={classes} />
<Button>Submit</Button>
</Group>
);
}
```
--- |
- adds an llm.md to public
- updates docs for guides/llms
I believe I've resolved the lint issues that were causing pipeline failure before. Additionally I've drafted a frontend route for you and modified the script to actually output the llms.txt following the https://llmstxt.org/ standard Here's a screenshot of the drafted route: ![]() |
Great, final changes left, please do the following:
|
Amazing! Thanks again for your help with this @rtivital. It's been a pleasure. Completed all those changes, should be finalized now! 🎉🥳🎊 |
Hey @rtivital I noticed some additional issues and pushed some important changes.
I outputted the LLM.md again for you to compare if you'd like. But I believe this to be a comprehensive generative script now. If you notice any other errors in that output though please let me know, but I'll remove the LLM.md file and generation for my next commit so it's ready to ship. Thanks so much again, David |
Add LLM.txt file generation script
Addresses open discussions:
Requirements
The script must:
Notes: