Replies: 1 comment
-
@rayfoss, if you mutate the AST in place, Markdoc will use that updated AST in the transform and render steps. This means that whatever you edit in the AST will eventually show up in your rendered output (as React or HTML). You can also write your own rendered, if you want to output something custom, like Vue or Svelte. We are considering a renderer that takes in the AST and outputs a valid Markdoc document string, though it would potentially be a better path to just contribute this as a feature of Prettier. Which path we take is still being considered. Hope that helps. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I didnt see anything in the documentation on modifying the AST and re-exporting to Markdown, or in lieu of that modifying the rendered HTML and importing it.
This can be done with turndown quite successfully. But it's not 100% reliable, and it's hacky if all you need is to refactor some yaml, latex or video tags.
https://stackblitz.com/edit/vitejs-vite-btuys7
Beta Was this translation helpful? Give feedback.
All reactions