Currently python is lacking decent markdown support (nothing equivalent to kramdown to have a proper parse tree and a good featureset).
Right now the closest implementation I found is mistune it is quite fast compared to the normal pure python markdown and in pure interpreter mode it is just 20x slower than C (using cython to speed it up makes it quite compelling).
The author isn’t interested in spending time on commonmark though.
Anybody knows of an implementation or is willing to work on mistune?
Hey, I’ve actually started work on a pure Python translation of the reference JS implementation.
I’m at the midway point, inline parser translated, doc parser to go.
My plan is get it passing the tests, then get it Pythonic. I’ll throw up a git repository of what I have this evening.
I don’t know too much about python packaging, and I know Windows users discover they have difficulty installing numpy because they don’t have VS2008. I was wondering on the relative merits of translating to pure python vs simply python bindings to the reference C implementation.
Currently working on a pure python port of stmd.js here. Still working on getting it to pass tests so contributors welcome… (although hopefully it should be finished after this weekend, or at least up to date with stmd.js)
This is pretty much finished now, it currently fails some entity and link tests (as stmd.js does) since it isn’t escaping URLs and replacing entities like ö, but I should finish that soon.
I cherry-backported a couple of fixes from the js update (lists and another) in my repository, but I’m tempted to refactor the codebase to match closely the current javascript. Sadly my time right now is scarce.
I’ve run into some issues with CommonMark-py encoding HTML in the wrong ways in code blocks, so I’ll work on the testing stuff and see if I can get a fix into your fork of this here: https://github.com/lu-zero/CommonMark-py
It looks like the Read the Docs project will take over maintenance of CommonMark-py, so this is the new repo location: https://github.com/rtfd/CommonMark-py
For anyone following this – as of about a month ago, rtfd’s CommonMark-py library mentioned above is now compliant with the latest commonmark spec (0.24). I’ll be trying to keep this library up to date, and any help and suggestions are welcome.