How to use precomputed mdast in react #728
-
Updating my website to use React and I was considering a solution where I could possibly precompile these snippets into mdast (e.g. build MD -> mdast using node.js in the development environment, and deploy JSON files containing the mdast), but then it occurred to me that Is there a feasable way to convert mdast trees into React elements? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Check out XDM https://github.com/wooorm/xdm#xdm (built on remark and mdast) |
Beta Was this translation helpful? Give feedback.
Check out XDM https://github.com/wooorm/xdm#xdm (built on remark and mdast)
And in particular the integrations with build tools and bundlers https://github.com/wooorm/xdm#integrations many of which build documents into static react components at build time.
That could be used directly or the approach could be reapplied to plain remark.