Closed rockaport closed 2 years ago
Yes, this will work.
The AST will have to have the right shape, of course. You can use ast.Print
to visualize ast for some example markdown documents to get familiar with expected structure.
I haven't done "build ast from scratch" approach but I did ast modifications.
You can see https://github.com/kjk/cheatsheets/blob/main/cheatsheets.go#L37 for example of traversing ast to extract information and https://github.com/kjk/cheatsheets/blob/main/cheatsheets.go#L104 for modifying ast (minor modifications).
I couldn't readily find out through the documentation/tests, but is it possible to programmatically generate a document using the ast types and render to a file using this library?
I'm thinking of something along the lines of
Thanks!