Converter from Markdown to CommonDoc.

Upstream URL


Alexander Artemenko




This is a wrapper around 3BMD markdown parser which produces documents in CommonDoc format. Also, it is able to render CommonDoc documents into the Markdown.

It is a proof of the concept, but I'm already using it in the documentation builder 40ANTS-DOC.

Note. This library is not compatible with CommonMark yet.


This library available only at now. To install it using Quicklisp client, do:

(ql-dist:install-dist ""
                      :prompt nil)

(ql:quickload :commondoc-markdown)

Parsing Markdown to CommonDoc

CL-USER> (common-doc.format:parse-document
          (make-instance 'commondoc-markdown:markdown)
# Hello World

* First item
* Second item
#<COMMON-DOC:SECTION title: Hello World, ref: NIL>

Writing CommonDoc to Markdown

Now we can render our document back to Markdown:

CL-USER> (common-doc.format:emit-to-string
          (make-instance 'commondoc-markdown:markdown)
"# Hello World

* First item

* Second item



variable commondoc-markdown/emitter:*generate-short-link-references* t

By default it is T, but you can bind it to NIL, to prevent short link references generation.

variable commondoc-markdown/emitter:*min-link-hash-length* 4

Minumum length of the hash for generated markdown links. This works only when *generate-short-link-references* variable is set to T.

variable commondoc-markdown/emitter:*emit-section-anchors* t

When this variable is T (default), emitter outputs a raw html <a name="some-id"></a> before each Markdown section.


  • Make commondoc-markdown compatible with CommonMark syntax.

[generated by 40ANTS-DOC]

Dependencies (16)

  • 3bmd
  • alexandria
  • babel
  • ci
  • cl-hamcrest
  • cl-str
  • common-doc
  • doc
  • docs-builder
  • esrap
  • ironclad
  • named-readtables
  • pythonic-string-reader
  • quri
  • rove
  • uiop

Dependents (1)

  • GitHub
  • Quicklisp