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
I'm trying to have Shiki Twoslash support in my mdx files, but I'm not sure it's currently possible.
My idea was to parse the original file as an AST, extract the code fences, send them to JavaScript for processing, and return them back before serializing it into mdx. However, the API here seems to only expose the compile function, which does both parsing and transformation. Would it be reasonable to split them in two operations?
The text was updated successfully, but these errors were encountered:
I am personally not a big fan of using Shiki with ASTs/VDOMs, because it generates strings of HTML. Which need to be parsed again. That kinda defeats the purpose of how all of unified, and this, is built! The entire benefit is that we go AST -> AST -> AST, which is fast!
Something like starry-night helps with that.
Would it be reasonable to split them in two operations?
You can get an AST with markdown-rs. It’s used in this project
I'm trying to have Shiki Twoslash support in my mdx files, but I'm not sure it's currently possible.
My idea was to parse the original file as an AST, extract the code fences, send them to JavaScript for processing, and return them back before serializing it into mdx. However, the API here seems to only expose the
compile
function, which does both parsing and transformation. Would it be reasonable to split them in two operations?The text was updated successfully, but these errors were encountered: