Replies: 2 comments 1 reply
-
Thanks for suggesting. Yes, I'm a fan of MDX. However, MDX leverages JSX, which is primarily targeted at single-page applications. Yes, we also use JSX to render components via JavaScript, but MDX would mean that the Markdown written by the author would need to be processed not only to static HTML but the JSX markup would need to be extracted and both would somehow need to be put back together when viewing the page. I can't see how this could be pulled off in a degree that solves the problem at scale, i.e. for all users and not just for a select number of special cases. Also, remember that Material for MkDocs generates a static site. It adds interactivity via JavaScript, but the rendering is all through HTML except for some exceptions like the version selector or search. Furthermore, adding MDX capability would not only need support by the theme, but by the Markdown parser. Thus, it would need to be implemented by Python Markdown or some other upstream project that delivers the final Markdown to be rendered to Material for MkDocs, which after all is "just a theme". So to answer your questions:
|
Beta Was this translation helpful? Give feedback.
-
Hey Martin, thank you very much for your exhaustive reply. Make complete sense! |
Beta Was this translation helpful? Give feedback.
-
Hey @squidfunk, first of all, congratulations on your project, fully love it: simple, beautiful, and powerful.
It would be very great if we could add support for MDX. This would allow to add JSX components and reuse the code. I read somewhere you loved it and thought about adding it as a feature ... but I couldn't find anything related to that, neither in the
mkdocs
website.Looking forward to hearing both Martin's opinion and the feedback from all the
mkdocs material
community! 🤗Thanks in advance for your consideration!
Beta Was this translation helpful? Give feedback.
All reactions