开发者

HAML or Jade template syntax available for Python?

Are there any template engines for Python with a syntax similar to Ja开发者_如何学JAVAde or HAML?


Check the pyjade Python package here at pypi, and here at github.

Pyjade is a Jade syntax adapter for Django, Jinja2 and Mako templates

Disclaimer: I am the owner :)


I really love jade. Pyjade made it possible to use jade in some python project with jinja or django.

But I have to say that pyjade is not 100% compatible with jade.

For example, ternary operator is not supported in pyjade. You can use some python syntax to do the same thing, But that will make the template only can be used with pyjade but not the original jade.

So if you want to share same templates between jade and pyjade, STOP. but if you just want to use jade syntax in a python project, pyjade will be good choice.


I'm not familiar with Jade, but I suspect you'll find this SO post interesting: HAML implementation for python / django


You can try https://github.com/avanov/Plim, it's very similar to jade.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜