Skip to content

Add markdown lib to bb #1825

@borkdude

Description

@borkdude

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:

(Yes, I know there's asciidoctor fans out here too, but limiting this discussion to markdown, sorry ;-)).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions