-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
markdown::to_hast
support
#27
Comments
Feel free to take the code for that now from here: https://github.com/wooorm/mdxjs-rs/blob/main/src/mdast_util_to_hast.rs. I don’t really know how to best expose those parts. And you will likely need more parts (hast-util-to-html). I don’t think they make a lot of sense here. Depends on how people want to use these things! |
Just fyi, I'm also in need of similar api exposure from mdxjs-rs, though I'm also not sure final shape of surface yet (under experimenting now). @wooorm Is this something acceptable in upstream mdxjs-rs PR to expose few interfaces as public? or the recommendation is copy-code-as needed? |
Can you tell me more about what you are working on? My previous comment still stands: you will likely need more things. Keeping it hidden for now means that some of the AST can still be improved. I’d particularly first like to:
After those two, I think it should be a stable API that can be exposed either from the crates currently or later from separate packages |
Sure, the current work I'm trying to do is integrate mdx support in turbopack (https://github.com/vercel/turbo). I'm still in the process of figuring out what's necessary piece, so I may wrong, but so far I came to conclude it requires 2-stage process for Again, please note this is not a final form and reason I mentioned |
Cool, interesting!
You mean that turbopack enforces this, right? So it has several hooks for plugins (likely also
|
afaik no clear docs around this unfortunately. I'm reading existing implementation to support other assets (js, css) - i.e there is a fn
This is great question and I do not have concrete answer yet, I'd like to play with my wip first to see how it looks like. |
For a first MVP, I’d go with just a
For a second MVP, I’d use a fork that specifies a Assuming we have MDX plugins soon, you could hopefully access those from options in the transform hook, and apply some of them on the markdown AST, some on the HTML AST, and some at the end in the JS AST. I’d be open to splitting these steps in 3 functions, and exposing those from |
Would it be supported in the future plan?
The text was updated successfully, but these errors were encountered: