problem with integrating an MDX editor with preview #382
-
The problem I am currently having is that I am building a docs website that will be maintained by non-technical people as well. When the changes are saved, they will be synced to the GitHub repo and start a new build of the application. Is there a way to create my own const page = getPage(params.slug);
const MDX = page.data.exports.default; // create this somehow from a markdown string <DocsPage toc={page.data.exports.toc}>
<DocsBody>
<h1>{page.data.title}</h1>
<MDX />
</DocsBody>
</DocsPage> Is this possible with the way Fumadocs works? Any ideas & suggestions are welcome Thanks a lot! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
To use Fumadocs MDX for this, you can’t access the raw content. The design of Fumadocs is indeed capable to handle custom content sources, but Fumadocs MDX doesn’t provide the raw content of files in consideration of memory usage. We do this because MDX files must be compiled statically to be optimised by Next.js and able to use Webpack loaders to load images. The presence of raw content isn’t necessary. Hence, the page doesn’t provide its raw content to support custom MDX compilers in server components. I wonder what do you mean by create an export, if you want to render the markdown to a react component, libraries like |
Beta Was this translation helpful? Give feedback.
To use Fumadocs MDX for this, you can’t access the raw content. The design of Fumadocs is indeed capable to handle custom content sources, but Fumadocs MDX doesn’t provide the raw content of files in consideration of memory usage. We do this because MDX files must be compiled statically to be optimised by Next.js and able to use Webpack loaders to load images. The presence of raw content isn’t necessary. Hence, the page doesn’t provide its raw content to support custom MDX compilers in server components.
I wonder what do you mean by create an export, if you want to render the markdown to a react component, libraries like
next-mdx-remote
could do it for you. The only problem left would be …