Skip to content
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

Example component doesn't exist? #117

Open
roginfarrer opened this issue May 14, 2024 · 1 comment
Open

Example component doesn't exist? #117

roginfarrer opened this issue May 14, 2024 · 1 comment

Comments

@roginfarrer
Copy link

Hey there, I'm trying to use mdxts to document a new hook and component I'm working on, and got kind of stumped on how the Examples component is supposed to work.

https://www.mdxts.dev/docs/examples/rendering

Examples can be rendered in MDX using the Example component. This component takes a source prop, which is the name of the example file or code block in any of the locations examples can exist.

I'm a little unclear about what this Example component does, and if it exists yet? I've tried to render it in an MDX file, and I get a message about it not existing. Looking at the project source code, it doesn't look like an Example component is provided either in mdxts/components or in the MDXContent component.

@souporserious
Copy link
Owner

Ah, this was leftover documentation from early on that I missed. I just pushed a commit to remove the irrelevant parts. I plan to add the Example component back at some point, just needed to trim scope for now.

If you have a simple example, you can import the component directly and render it. Or if you want to use the example metadata the MDXTS site examples page is a good resource for how it can be used.

It sounds like you could get away with something simpler though and might only need ExportedTypes which helps for type documentation. There might be some kinks in the generated type docs still so please let me know if you run into anything if you decide to try it and I can take a look.

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

No branches or pull requests

2 participants