freekrai / remix-docs

Remix stack for an MDX docs site that is quick to set up and customize
https://remix-docs-five.vercel.app
MIT License
46 stars 9 forks source link

Import component into `.mdx` file? #1

Closed callumflack closed 2 years ago

callumflack commented 2 years ago

Have you experienced this bug with the latest version of the template?

Yes

Steps to Reproduce

Import a component form the app/components directory into an .mdx file.

Expected Behavior

Import and render a component.

Actual Behavior

It renders a text string, not an imported component.

image
callumflack commented 2 years ago

@freekrai this is really nice template, thank you. Kind of standardises a number of approaches, love the option between remote versus local. I am genuinely confused about the component import though.

freekrai commented 2 years ago

This uses Stripe’s Markdoc for rendering so it’s a tad different.

You’d have to add components via https://github.com/freekrai/remix-docs/blob/main/app/components/Markdown.tsx and https://github.com/freekrai/remix-docs/blob/main/app/utils/markdoc.server.ts

freekrai commented 2 years ago

I'm working on some docs around this stack which will include a section on markdoc and adding more components.

callumflack commented 2 years ago

Ah yes, my bad. Thanks 🙏🏻

callumflack commented 2 years ago

MarkDoc docs are solid, might only need a quick overview of it.

freekrai commented 2 years ago

Yeah markDoc is nice