Python module and cli tool


Hey, I’ve just finished porting, extending, and packaging a pure python (only using system modules) port of John MacFarlanes stmd.js implementation. I added on further HTML entity unescaping (as done in the C version) and href URL % quoting as well as JSON output of the AST. Much like most of the other ports/implementation I won’t do a v1.0 release until the spec is considered stable and will attempt to keep up with changes, but for now I’ve released a v0.5.0 version, you can get it from PyPi, here, or just typing

$ pip install commonmark

If you find any bugs/etc the GitHub repo can be found here. Note: If you use python 3.3 or lower you may see artifacts where HTML entities won’t be properly unescaped, I am currently working on a workaround for this… NOTE NOTE I fixed this, all versions now unescape HTML5 entities properly!

ENJOY :slight_smile:



More notes!
I’ve started working on a tool (that I may later merge into CommonMark-py) to check the validity of the CommonMark AST structure read from either a JSON file or STDIN that may be of use to other people writing implementations to check their AST output. It’s here!

1 Like


I built upon remarkdown and used the CommonMark-py as parser.

Not sure what’s the best regarding distribution, @rolandshoemaker might be useful to add this docutils bridge in the normal CommonMark-py or make it a stand alone package? Hopefully soon I’ll check how good it is with sphinx and probably I’ll move trying to integrate it with emeraltree/moin.