-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Parse mermaid text into json or AST #2523
Comments
The data is stored in in a diagram specific representation after parsing. I would not that difficlt to dump it to some other format like JSON but there is no built in functionality for that. |
+1 for support for dumping or otherwise exposing access to the AST, in the Mermaid API. |
Over a year has passed; are there any updates to this issue? 👀 I want to create a tool using the Mermaid API and get the AST, but it looks like it's not currently possible. |
https://stackblitz.com/edit/node-5crpy6?file=index.mjs&view=editor It's actually there. Curious no one answers. |
Each diagram has its own database, but it doesn't show any internal stuff. For example, in your given code, it doesn't show where each node has been declared, its start and end, or how each node has been declared; much more depends on each diagram. |
Thank you. It looks like a real possibility of working with JSON, and making changes easier. But it's not well documented. The main function used Probably updating docs, can be the solution for this problem. |
Quick note for future readers, this solution works but depending on your input it requires you to call |
Hi! I want to use JSONNET for generating diargrams of different components that could be interconnected with each other by referencing. Can we make that possible ? |
Is there a way to parse mermaid text into an AST? I want to render mermaid diagrams in an environment that uses its own elements, not svg. I believe having an AST representation would make this easier as I could walk through it and draw out the diagram myself.
The text was updated successfully, but these errors were encountered: