mark icon indicating copy to clipboard operation
mark copied to clipboard

🔥 New feature: add support for mdx

Open SleepWalker opened this issue 3 years ago • 3 comments

Hello,

mdx is a markdown extension, that allows to use React inside md files. React components can be used to replace current approach with macros. As a result we will get much more flexible and customizable tool.

There is only one problem. Looks like mdx requires to add JavaScript in the mix, but I saw there are already go project that mixing in js parts: https://github.com/jxnblk/mdx-go. I'm not a go developer, so I don't know the best way to add mdx support inside go project.

If mdx support goes completely against current vision of mark development can I request another feature? It would be cool allow setting up "compiler" for files so that the mark will delegate md/mdx -> html conversion to some external command. In such way someone like me will be able to replace default md parsing with the custom one.

SleepWalker avatar Aug 12 '21 09:08 SleepWalker

I think having external compilers would be a pretty cool addition and be used for #49

sofixa avatar Aug 12 '21 15:08 sofixa

I've successfully integrated mdx (react) with mark. There are still some little things to fix but it seems to work! I'm planning to publish my work as a separate package and gradually rewrite it to js

SleepWalker avatar Aug 21 '21 17:08 SleepWalker

@SleepWalker i think it'd be interesting if you share your mixed go/js version, to see how you've implemented it, which could be helpful for other js based integrations ( like mermaid.js).

sofixa avatar Aug 21 '21 17:08 sofixa