Questions tagged [pyjade]

Jade syntax adapter for Django, Jinja2 and Mako templates

PyJade is a high performance template preprocessor, that converts any .jade source to the each Template-language (Django, Jinja2 or Mako).

35 questions
8
votes
2 answers

getting DistributionNotFound error, but package exists

I am running pyjade for Django templates as I find it much easier to write in, but I am trying to convert it to html with the built in converter. When I run pyjade -c django input.jade output.html I get the error pkg_resources.DistributionNotFound:…
Hat
  • 1,691
  • 6
  • 28
  • 44
5
votes
1 answer

Including mixins in pyjade workaround

As mentioned in the github issue #70 including mixins aren't supported. Are there any good workarounds or alternative solutions?
Albin
  • 2,410
  • 2
  • 29
  • 27
5
votes
1 answer

How do I import mixins using `pyjade` efficiently?

Referring to https://github.com/SyrusAkbary/pyjade/issues/27, it seems the jinja2 does not allow importing mixins from external files. However, I got a helper.jade which has loads of mixins. If I need to use many different mixins from one file, does…
heartbreaker
  • 85
  • 2
  • 5
4
votes
4 answers

Using python code in pyjade

I'm trying to generate a list using pyjade, like so: ul - for i, (label, link) in enumerate(tabs) li(class="selected" if i == selected_index else "") a(href=link)= label But I see this error: UndefinedError: 'enumerate' is undefined I…
Chung Wu
  • 2,357
  • 3
  • 21
  • 19
4
votes
2 answers

{{ STATIC_URL }} with pyjade in django

I have some trouble adding my CSS in my template using {{ STATIC_URL }}. The tag does not work inside the link markup, but works anywhere else. This: {{ STATIC_URL }} correctly translated into /static/ , but link(href="{{ STATIC_URL…
Taufiq Muhammadi
  • 352
  • 4
  • 12
3
votes
4 answers

Bootstrap Wizard next tab on image click and capture value

I have a form with Twitter Bootstrap Wizard and I have several images that when I select one, I must store locally the value and go to the next tab (o._nextTab). When I click the image it should go to the next tab, but currently is not working. This…
3
votes
1 answer

declare variable in template

Is there any way to declare a variable inside a template? I am pushing the users values for radio buttons, checkboxes and text inputs to the template in the hopes of having their previous selection set as checked/filled in. In this example, their…
Hat
  • 1,691
  • 6
  • 28
  • 44
2
votes
2 answers

How to include inline content in pyjade

I had the following code in my jade file: a(href='{{url_for("browse_problem", problem_id=problem._id)}}') I was trying to evaluate the url_for function and set the value as the href attribute, but the code above does not work. Can someone help me…
dementrock
  • 917
  • 3
  • 9
  • 21
2
votes
1 answer

Django compressor offline compress with pyjade

I'm using pyjade in my django project. I also started using django compressor and for performance issues I need to use the offline compression. I set the COMPRESS_OFFLINE to True in my settings.file I ran the command: "manage.py compress…
ignacio.munizaga
  • 1,553
  • 1
  • 23
  • 28
2
votes
1 answer

Django can't find jade template

I've followed the install guide on pyjade website and rewritten all my templates in my Django project. However, Django doesn't seem to find templates when I use the extends tag in templates. extends 'base.jade' When I try to extend another template…
oyvindym
  • 352
  • 1
  • 2
  • 15
2
votes
1 answer

Jade-like templating language for python and javascript

Is there a templating language like jade that is for both python and javascript and has the same syntax on each? Pyjade does not have the same syntax for the engine-specific parts as jade, and therefore will not work for me. I am willing to use…
fread2281
  • 1,136
  • 1
  • 11
  • 31
1
vote
1 answer

PyPugJs with Pyramid - Basic

I am trying to use PyPugJs with Pyramid. Inside my __init.py, I have this config.include('pypugjs.ext.pyramid') Inside views.py, @view_defaults(renderer='json') class St2Views: """docstring for St2Views""" def __init__(self, request): …
sarincasm
  • 477
  • 3
  • 9
1
vote
1 answer

Jade array as item for Django

I'm using PyJade in Django and i have a problem with association of arrays with item. In Django Template: {% get_providers as socialaccount_providers %} How can i make this using Jade?
1
vote
0 answers

Python & Jade iteration of a dictionary : ValueError: too many values to unpack

I have the following dictionary i want to iterate with pyjade: stations = {'ren': 'RENA', 'hum': 'Hummelvoll'} In my index.jade i have the following snippet: each val, index in stations li= index + ': ' + val This raises a "ValueError: too…
Peter
  • 57
  • 5
1
vote
1 answer

Using `with` in pyjade and Flask

I'm trying to convert this html {% with messages = get_flashed_messages() %} {% if messages %} {% for message in messages %} {% endfor %} {% endif…
Dramal
  • 167
  • 2
  • 10
1
2 3