docpad-archive / docpad-plugin-jade

Adds support for the Jade templating engine to DocPad.
Other
17 stars 8 forks source link

Pass marked to jade as a filter #2

Open kizu opened 11 years ago

kizu commented 11 years ago

Is there a simple way to attach marked from its plugin to the Jade's plugin, so we could use the :markdown filter there?

Delapouite commented 11 years ago

Filters like markdown seem hardcoded directly in Jade itself : https://github.com/visionmedia/jade/blob/master/lib/filters.js#L61

What may be possible is to redefined existing filters with customs ones that try to require the corresponding docpad-plugin-* as explained by TJ : https://groups.google.com/forum/?fromgroups=#!topic/express-js/9qwH_u2mi14

supersym commented 11 years ago

Yeah I was under the same impression about jade filters when trying to call template data from :coffeescript in docpad. Strangely enough using the buffering or iteration inline code (- or = or !=) all work. Also I fail to see the problem with markdown: except the obscure double space line ending to create a break, everything else is working just fine and from that last link Delapouite posted above here I conclude jade's internal rendering tries up to 4 different engines/packages before it surrenders and tells you to install one. Having docpad-plugin-marked makes docpad-plugin-jade use that one possibly (no idea) but I have globally installed most important stuff including 'jade' and 'marked' packages (not the plugins) which could make the difference.