remark-shortcodes icon indicating copy to clipboard operation
remark-shortcodes copied to clipboard

Migrate to remark@v13 and it's new parser (micromark)

Open wooorm opened this issue 5 years ago • 7 comments

Hi!

remark is switching to a new parser (and compiler) internally (micromark, remarkjs/remark#536), which will break this plugin. This plugin seems a bit similar in style to footnotes. There is a micromark extension and mdast extension for that already, and soon those two will be in the remark wrapper plugin remark-footnotes. Keep an eye out for that update, which might serve well as inspiration, and feel free to ask me questions!

wooorm avatar Oct 03 '20 16:10 wooorm

If anyone would like to take the work on to move this package onto the new remark (v13+) & micromark system then please reply here. I don't use this package myself anymore, so I won't be tackling the work but am more than happy to keep reviewing + maintaining it for the time being.

Just shout :)

djm avatar Jan 30 '21 13:01 djm

/cc @ChristianMurphy I remember you were using this plugin somewhere? Or was it something else?

Also: for other folks seeing this: directives are somewhat semi-standard (implemented in many markdown parsers) and can do similar things to shortcodes, so if a different syntax is fine, maybe it’s of interest: https://github.com/remarkjs/remark-directive

wooorm avatar Jan 31 '21 14:01 wooorm

I do have a project that uses this, though the project is now in maintenance, rather than active development. I'm in a similar spot as @djm, I don't have rewriting the parser on my roadmap at the moment, but am happy to review a PR if a community member opens one.

ChristianMurphy avatar Feb 01 '21 00:02 ChristianMurphy

so if a different syntax is fine, maybe it’s of interest: remarkjs/remark-directive

Nice, thanks @wooorm.

If this works for folks, I would 100% suggest going down this route given it's a core-maintained package.

I'll update the README to point to that.

djm avatar Feb 01 '21 12:02 djm

CleanShot 2021-02-01 at 12 05 09@2x

Done! Thanks again.

djm avatar Feb 01 '21 12:02 djm

Awesome! Yeah, I’d suggest folks to use directives. Different extensions are possible, but it extensions always make your content less portable. Directives are perhaps slightly better because it’s “somewhat semi-standard”

Thanks for adding it to the readme Darian!

wooorm avatar Feb 01 '21 16:02 wooorm

~~Does anyone have a usage example of https://github.com/remarkjs/remark-directive?~~ ~~The example from their README isn't very easy to understand/follow. 😕 Thanks!~~

I've found a nice working example here: https://github.com/remarkjs/react-markdown/issues/585#issue-871290173

lucascaton avatar Jul 23 '21 10:07 lucascaton