h0tk3y/better-parse

Parsing Markdown

rshah opened this issue · 4 comments

rshah commented

is it possible to use this library to parse Markdown?

It should be possible to build a Markdown parser using this library (as it is possible to parse json – I’ve successfully built a sample toy Json parser using better-parse).

But for any production use-case I’d rather go for a dedicated Markdown parser library instead of crafting my own using parser combinators. Just as I use Jackson and its kotlin modules in work, instead of my example linked above.

Not sure what are good libraries for Markdown on JVM (as I never neeeded to parse it), but I’d guess something klike intellij-markdown would be a good choice.

@rshah Defining a Markdown grammar does not seem to be a practical way of parsing Markdown, see http://roopc.net/posts/2014/markdown-cfg/
I think I can try and come up with a demo parser if I have any success.

@silmeth Can I reference your Json parser in the examples section? It would also be kind of you to update it to the 0.3.1 release.

@h0tk3y Sure. I wrote it to familiarize with your library and decided to put it on Github as a reference for anyone who similarly wants to see how such a grammar might be written, so I’d be really flattered if the original library referenced my toy example. Thanks. :)

I’ll look into the new release today. Not sure if I bump up the version immediately (are there any big API changes? new features that a simplish json parser should use?), though. Also, if you’d like to do it yourself, I don’t mind accepting a PR. :)