eudicots / Cactus

Static site generator for designers. Uses Python and Django templates.
BSD 3-Clause "New" or "Revised" License
3.46k stars 315 forks source link

Why markdown2 vs markdown? #81

Open levskaya opened 10 years ago

levskaya commented 10 years ago

Cactus is amazing, but I'm curious as to the choice of markdown2 over the original python markdown? There's the impression that markdown2 is faster than markdown, but this is simply not true, e.g.: http://lepture.com/en/2014/markdown-parsers-in-python https://github.com/trentm/python-markdown2/issues/154

I've used both and vastly prefer the original markdown - it's much simpler to write plugins/mods for python-markdown as it's built to be extensible. (This is critical for things like Mathjax, where you need to tweak the parsing/transform order to preserve mathematical content.)

koenbok commented 10 years ago

I don't recall a specific reason. I think I read it was better somewhere and just went with it :-) It shouldn't be hard to replace with the original markdown implementation I think.

lepture commented 10 years ago

@levskaya Why do you need plugins for Markdown? Isn't renderer much simpler?

levskaya commented 10 years ago

@lepture I'm not entirely sure what you mean by "renderer" here - are you referring to a django formatter or something else?

The main reason I want plugins is to use latex mathematical markup for mathjax - a frontend TeX implementation that renders inline latex to html/css. It uses enough special characters that they need to be guarded from transformation by markdown. It was easy for me to hack this in, and I don't expect my esoteric needs to dictate changes to the core of this lovely project. However, there's lots of people that end up tailoring markdown for their special needs. The "original" python-markdown makes this easy with a well thought out parsing/transform pipeline and native support for plugins, whereas trying to add things to the monolithic python-markdown2 always ends up as an ugly hack.