Open egasimus opened 11 years ago
Interesting question. There are non-implemented features like this e.g. https://github.com/SyrusAkbary/pyjade/issues/38
I want that feature to be implemented to have ability to write templates in DRY way, i.e. to have one file with macros, not repeating them every time.
That's something quite important! Perhaps there is a way to run PyJade against Jade's test cases as a measure of compliance?
Personally, I am just trying to use Jade with Django; sure I could compile it to Django templates via Jade+Grunt, but I do prefer to use the optimized template tag syntax that PyJade seems to provide. (- tag
instead of | {% tag %}
; things like native - for
loops).
One issue I can specifically remember running into while trying to follow the official docs was this:
Jade does inline if/else with the ternary ?: operator while PyJade uses the pythonic if/else. Once I figured this out the fix was simple but, it did take a little hair-pulling to get there!
+1 for a centralized differences list of some sort
@briancappello I just experienced the same issue and your comment brought me back from the edge of insanity. Django doesn't throw a great exception either.
+1. Would be super useful.
Basically, I am using the techniques described in here to pass data between templates.
The jade is like
template.jade:
!!!
html
block vars
head
title #{pageTitle} - default www title
body
home.jade
extends template
block vars
- var pageTitle = 'Home'
I am wondering if it is possible to properly compile jade code related to defining variable and any operation on variable because pyjade 3.1.0 outputs (jade -> jinja)
{% block vars %}{% var pageTitle='home' %}{% endblock %}
This is not a valid jinja syntax.
Basically, is PyJade up to date with the current release of Jade?