souporserious / mdxts

The Content and Documentation SDK for React

Home Page:https://mdxts.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example component doesn't exist?

roginfarrer opened this issue · comments

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.

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.