I would prefer an AST which was moderately easily returned to markdown, rather than one which is lower level (which I'd consider HTML to be) but not a bad idea if other options aren't useful inspiration enough, thanks.
A brief glance suggests github.com/icyleaf/markd/bloโฆ is the AST -- is that right? (While I said any language will do, Crystal and Ruby are not ones I'm yet familiar with navigating)
Nice. There will be easier to use options (e.g. using serde and yaml-rust directly to convert from yaml to Rust structs) but if you care about provenance and reporting errors then you might find `marked-yaml` to be of use :D Issues and PRs *gratefully* received.
I've been directed toward mdast by someone in another place, but looking at those other impls sounds sensible too. Pandoc's AST is so far the most obvious thing to crib from.
The spec is definitely useful, though it doesn't really come out and say "this is the AST" it's more of a set of rules for identifying and parsing the components. AFAICT. Perhaps I missed an AST definition in my skim?
I am working on a tool with a friend which consumes markdown as a semi-structured input format. In order to better report errors in the input, I want to be able to point at the line (and column perhaps) where the error exists.
Not quite. I am putting together a provenanced Markdown AST and want to ensure that it's as nicely structured as it can be. Parsing Markdown is a total pig, but there're good libraries for that already.
Dear Lazyweb/Twitterverse,
Do you have a favourite Markdown AST? I am already looking at Pandoc's AST for inspiration, but other examples would be useful.
Any programming language is fine, I am capable of consuming ideas from most genres.
Thanks, D.
For those interested, it's primary purpose is to allow you to report back to users when configuration values are bad etc, in a more effective way. Everyone loves provenanced errors.
This morning I released version 0.1.0 of `marked-yaml` which is a @rustlang library crate for a simplified YAML data structure which provides spans (or at least start marks) for all the data you parse out of YAML strings.
crates.io/crates/marked-yaml