News for hackers. Stuff that matters.
Re:On yak shaving and <md-block>, a new HTML element f... by gravypod on Friday November 26, 2021 @02:57PM (#29353519)
I 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.

Re:On yak shaving and <md-block>, a new HTML element f... by westurner on Friday November 26, 2021 @07:03PM (#29355651)
Jupyter-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 :

> 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 :

> 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 :

> 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

Re:On yak shaving and <md-block>, a new HTML element f... by c0balt on Friday November 26, 2021 @06:14PM (#29355285)
Hmm, 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

Re:On yak shaving and <md-block>, a new HTML element f... by gravypod on Friday November 26, 2021 @06:35PM (#29355433)
I 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.