pyjade icon indicating copy to clipboard operation
pyjade copied to clipboard

State of PyJade vs Jade

Open egasimus opened this issue 11 years ago • 6 comments

Basically, is PyJade up to date with the current release of Jade?

egasimus avatar Jul 31 '13 19:07 egasimus

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.

andrewboltachev avatar Jul 31 '13 20:07 andrewboltachev

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).

egasimus avatar Jul 31 '13 20:07 egasimus

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 avatar Aug 01 '13 02:08 briancappello

@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.

robusto avatar May 04 '14 07:05 robusto

+1. Would be super useful.

shon avatar Oct 08 '14 13:10 shon

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.

edwardfung123 avatar Oct 06 '15 09:10 edwardfung123