Is it possible to load mdx from memory instead of file system?
See original GitHub issueGoal
The end-goal would be to define customer-specific pages and complex layouts, all stored on the DB, and allow a much higher level of customisation, from a customer perspective. (based on existing set of React components they could use and that’d be at their disposal)
I’d love the ability to load content stored in a DB, with some records containing markdown, and I would like to know if that’s possible to load such content as MDX.
Basically, it’s what’s possible already, except it doesn’t load the content from the filesystem.
This would allow advanced use case of content customisation, with the awesome ability to use complex JSX components at runtime.
An example:
DB record product.description
, as long text (or similar):
# Product title
Some description
<Subscribe />
Subscribe
is a JSX component that could be made available through the MDXProvider
(or another way?).
This would grant an ability that’s not achievable even by using supposedly more powerful HTML.
Use case:
- Customer who wants to have access to powerful components/integrations while still writing “just” markdown
Problem
A file-based approach is too limiting for such things, it’s not as flexible.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
@Vadorequest I think this is what you are looking for:
https://github.com/hashicorp/next-mdx-remote
@johno I tried with MDX but really didn’t go far. I just didn’t get it.
Using https://github.com/probablyup/markdown-to-jsx, I got it working super fast, and eventually left behind MDX in favor of https://github.com/probablyup/markdown-to-jsx.
So, if your goal is to increase the adoption of that particular feature, I suggest you make it easier to get started with, use examples and such. 😃