[IPython-dev] Templating library for IPython

Brian Granger ellisonbg at gmail.com
Tue Feb 7 00:51:09 EST 2012


In the IPython notebook we are quickly reacing the limitations of the
Tornado templating engine.  I love the syntax and flexibilty, but it
requires that all templates be in the same directory.  This is
preventing us from organizing the notebook code in a more scalable way
where each page's resources (templates/css/js/request handlers) are
put into a common subdirectory.  I have been looking at the various
templating engines and am thinking about switching over to jinja2.
Relative to other templating libs for Python here are the main
advantages I see for IPython:

* The syntax is very close to that of tornado.  This will make our
existing templates easy to port and require little brain power for our
* It has very flexible ways of tracking all of your templates in
different locations.  As the notebook grows in complexity this will be
* Jinja2 seems to be well maintained and popular.
* Experimental Python 3 support.


What do people think about this plan?
How would we handle the dependency issue?  We could put jinja2 in
externals, but we would have to change all of its import statements.



Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger at calpoly.edu and ellisonbg at gmail.com

More information about the IPython-dev mailing list