3 ms·
there is the commonmark specification https://spec.commonmark.org/0.30/ https://spec.commonmark.org/0.30/
by rain1 5y ago
there is the commonmark specification https://spec.commonmark.org/0.30/ https://spec.commonmark.org/0.30/
- gravypod 5y agoI work a lot with common mark and hoedown for work. There's no formal Grammer for parsing markdown unfortunately. The closest thing to what the parent comment is talking about is pandoc which most people are afraid of because Haskell is scary and the markdown format they use is strange. Also all of the parsers for md are very complicated.
- c0balt 5y agoHmm, have you tried pulldown-cmark. It's not easy-perse but it's readable and has an awesome interface. Though it's rust so the interface usability might differ for other languages. Github: https://github.com/raphlinus/pulldown-cmark https://github.com/raphlinus/pulldown-cmark
- gravypod 5y agoI haven't played with too much Rust but any new projects address a lot of the difficulties with dealing with the legacy libraries. Mainly: they're not written in C.
- westurner 5y agoJupyter-book depends upon MyST-NB (MyST Notebooks) which depends upon myst-parser which depends upon markdown-it-py (which is a port of markdown-it (TypeScript)) for parsing [MyST] Markdown. https://github.com/executablebooks/myst-parser https://github.com/executablebooks/myst-parser : > MyST is a rich and extensible flavor of Markdown meant for technical documentation and publishing. > MyST is a flavor of markdown that is designed for simplicity, flexibility, and extensibility. This repository serves as the reference implementation of MyST Markdown, as well as a collection of tools to support working with MyST in Python and Sphinx. It contains an extended CommonMark-compliant parser using markdown-it-py, as well as a Sphinx extension that allows you to write MyST Markdown in Sphinx. https://github.com/executablebooks/markdown-it-py https://github.com/executablebooks/markdown-it-py : > Follows the CommonMark spec for baseline parsing; Configurable syntax: you can add new rules and even replace existing ones; Pluggable: Adds syntax extensions to extend the parser (see the plugin list), High speed (see our benchmarking tests) ; Safe by default https://github.com/markdown-it/markdown-it https://github.com/markdown-it/markdown-it : > Follows the CommonMark spec + adds syntax extensions & sugar (URL autolinking, typographer), Configurable syntax!; You can add new rules and even replace existing ones; High speed; Safe by default; Community-written plugins and other packages on npm