You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve markdown infrastructure: global markdown config, new lifecycles... #4625
We should allow users to configure default markdown config globally, change Docusaurus Markdown defaults, and make it possible to create markdown-related Docusaurus plugins.
It should be technically possible to replace things like <Tabs> by the respective theme component, so that interactive elements are still possible without MDX. The difference is that you'd likely have to declare the available components ahead of time in config/lifecycles instead of importing them inline in the MDX file (which IMHO is not the most convenient even with MDX)
Activity
nilsocket commentedon Apr 16, 2021
Edit by @slorber: context is (#3018 (comment))
I write notes of whatever I study in markdown files organized into folders.
I use vscode-markdown-preview-enhanced, which works perfectly for all my use-cases.
I need my content to be accessible, on other devices like mobile, for revision purposes.
I was thinking to host a local server which serves
.mdfiles.As I'm not familiar with front-end development, it's confusing to configure and I don't understand much.
But the link which you have provided is fine for me. I will configure it.
Thanks a lot.
slorber commentedon Oct 8, 2021
The markdown global infrastructure should allow site owners and themes to register mdx components and scope.
This would remove the need to use mdx imports, and also ensure the blog post RSS feed can evaluate MDX nodes properly. See also #5664
Josh-Cena commentedon Oct 8, 2021
Question: won't this conflict with #3018? Are we going to allow swapping out Markdown parsers, or are we going to build our infrastructure on MDX?
slorber commentedon Oct 8, 2021
When using CommonMark, we'll likely inject the markdown in components prop as JSON AST, rendered on the client with https://github.com/remarkjs/react-markdown
It should be technically possible to replace things like
<Tabs>by the respective theme component, so that interactive elements are still possible without MDX. The difference is that you'd likely have to declare the available components ahead of time in config/lifecycles instead of importing them inline in the MDX file (which IMHO is not the most convenient even with MDX)slorber commentedon Oct 8, 2021
My definitive goal is that the Docusaurus site could render the same in both CommonMark + MDX, with a simple config switch and CI tests for each mode.
This might need some docs adjustments but I believe it should be possible without removing any existing feature.
Josh-Cena commentedon Mar 25, 2022
Going to close this in favor of #5568, #3018 and #6370. Those are smaller and more concrete proposals that seem more actionable.