Hi Jinja Dev Team,
My name's Jon and I am working on iPython, in particular the nbconvert
(notebook conversion) tool. We recently decided to use Jinja2 as our
templating engine. I'm working on a latex-sphinx style exporter. My
template inherits like so:
null>display_priority>latex_base->latex_sphinx_base
The logic for the output (loops and notebook processing) is all stored in
the null template. The templates that follow expand upon the very basic
structure that the null template provides.
A very simplified, easy to follow, pseudocode example of the logic in the
null template is
<body block>
> <for each cell in worksheet>
> cell by cell stuff here ...
<end for>
> </body block>
Then the latex_base does something like this
<body block>
> \\*latex I dont want...
> * <super()>
> </body block>
I want to override the body block within my sphinx-base and ditch the latex
in the latex_base for that block; HOWEVER, I don't want to loose the loop
logic from the null template.
I looked online and I found someone suggest super(n), where n is the order
of the parent you want to access. I tried it and it didn't work (maybe
it's a Jinja 1 thing?) I also tried super().super() (wasn't suprised that
didn't work, but thought it was worth a try.)
Basically I'm trying to find a way to access the parent, parent's
implementation of the body block, WITHOUT loosing all the other blocks in
the latex_base (otherwise I would just inherit from display_priority
instead of latex_base.)
If I have to, I can add more blocks to the latex_base, and just override
those in my template as blank, but that seems like a cheesey work around.
Ideas? Functions I'm missing?
Thanks,
Jon
--
You received this message because you are subscribed to the Google Groups
"pocoo-libs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pocoo-libs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.