-
-
Notifications
You must be signed in to change notification settings - Fork 258
Description
I'm contemplating adding a markdown library to babashka.
The reasons for this are as follows:
Babashka already has built-in (= performant) support for common formats: EDN, JSON, CSV, YAML. Markdown is a common format. Adding this will make bb a good engine to build static blogging frameworks on.
markdown-clj is pretty good and bb-compatible, but it doesn't implement the CommonMark spec to the letter (it parses stuff line by line, which gets you 90% there but it has some quirks). Quickblog is already a bb-compatible blogging framework which uses markdown-clj. A built-in library would provide even better performance and CommonMark compliance (depending on the chosen lib).
Clerk support. As we speak I'm writing notebooks in babashka with clerk (with a locally compiled bb, see comment in #clerk). Clerk needs a markdown library which spits out an intermediate AST before going all the way to HTML.
I've tested https://github.com/nextjournal/markdown for this (which is used in clerk) and it only adds 1MB to the binary (from 69MB to 70MB) which may very well be worth it.
Any thoughts on this? Any other use cases you would have for a markdown library in bb?
Issues reported with markdown-clj that violate the commonmark spec:
- When a linebreak occurs in a link, the link is not parsed. yogthos/markdown-clj#97
- List with multiple paragraphs yogthos/markdown-clj#100
- Strange behaviour with html comments. indended? yogthos/markdown-clj#114
- Incorrect rendering of double hyphen within backqotes yogthos/markdown-clj#146
- Apostrophe in URL causes parser to fail to parse automatic links yogthos/markdown-clj#156
- Ordered and unordered lists are combined unless separated by three newlines yogthos/markdown-clj#170
- Bad italics with underscores within word yogthos/markdown-clj#180
- Exception thrown when parsing lists yogthos/markdown-clj#181
- HR lines written with consecutive - characters are superseded by empty headings yogthos/markdown-clj#190
(Yes, I know there's asciidoctor fans out here too, but limiting this discussion to markdown, sorry ;-)).