Question

Let's say, that I have a template written in mako: base.mako. I would like to use it as a renderer in a view named: base_view. Also I have a template written in mako named: concrete.mako, which inherits from base.mako this way: <%inherit file="base.mako" />. It is used by different view.

Question:

I would like, to rewrite concrete.mako in pyjade (as a concrete.jade), and on rendering it, I would like it to compile to mako, and then to compile to concrete html. How to set it up in pyramid (it would be great, if the pyramid system will use different renderers depending on file extension, and after using pyjade will also compile pyjade output with mako compiler to concrete html).

Thx.

Was it helpful?

Solution

Well pyramid does use different renderers based on file extension. However they do not cascade or anything, a renderer just returns a string. I think you'll have to write your own .jade2mako2html renderer to do what you're asking.

http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/renderers.html#adding-and-changing-renderers

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top