\select@language {english}
\contentsline {chapter}{\numberline {1}Introduction}{1}{chapter.1}
\contentsline {section}{\numberline {1.1}Prerequisites}{1}{section.1.1}
\contentsline {section}{\numberline {1.2}Installation}{1}{section.1.2}
\contentsline {subsection}{\numberline {1.2.1}As a Python egg (via easy\_install)}{1}{subsection.1.2.1}
\contentsline {subsection}{\numberline {1.2.2}From the tarball release}{1}{subsection.1.2.2}
\contentsline {subsection}{\numberline {1.2.3}Installing the development version}{2}{subsection.1.2.3}
\contentsline {subsection}{\numberline {1.2.4}More Speed with MarkupSafe}{2}{subsection.1.2.4}
\contentsline {subsection}{\numberline {1.2.5}Enable the debug support Module}{2}{subsection.1.2.5}
\contentsline {section}{\numberline {1.3}Basic API Usage}{2}{section.1.3}
\contentsline {section}{\numberline {1.4}Experimental Python 3 Support}{3}{section.1.4}
\contentsline {chapter}{\numberline {2}API}{5}{chapter.2}
\contentsline {section}{\numberline {2.1}Basics}{5}{section.2.1}
\contentsline {section}{\numberline {2.2}Unicode}{5}{section.2.2}
\contentsline {section}{\numberline {2.3}High Level API}{6}{section.2.3}
\contentsline {section}{\numberline {2.4}Autoescaping}{11}{section.2.4}
\contentsline {section}{\numberline {2.5}Notes on Identifiers}{11}{section.2.5}
\contentsline {section}{\numberline {2.6}Undefined Types}{11}{section.2.6}
\contentsline {section}{\numberline {2.7}The Context}{13}{section.2.7}
\contentsline {section}{\numberline {2.8}Loaders}{14}{section.2.8}
\contentsline {section}{\numberline {2.9}Bytecode Cache}{16}{section.2.9}
\contentsline {section}{\numberline {2.10}Utilities}{18}{section.2.10}
\contentsline {section}{\numberline {2.11}Exceptions}{20}{section.2.11}
\contentsline {section}{\numberline {2.12}Custom Filters}{21}{section.2.12}
\contentsline {section}{\numberline {2.13}Evaluation Context}{21}{section.2.13}
\contentsline {section}{\numberline {2.14}Custom Tests}{22}{section.2.14}
\contentsline {section}{\numberline {2.15}The Global Namespace}{23}{section.2.15}
\contentsline {section}{\numberline {2.16}Low Level API}{23}{section.2.16}
\contentsline {section}{\numberline {2.17}The Meta API}{24}{section.2.17}
\contentsline {chapter}{\numberline {3}Sandbox}{25}{chapter.3}
\contentsline {chapter}{\numberline {4}Template Designer Documentation}{27}{chapter.4}
\contentsline {section}{\numberline {4.1}Synopsis}{27}{section.4.1}
\contentsline {section}{\numberline {4.2}Variables}{28}{section.4.2}
\contentsline {section}{\numberline {4.3}Filters}{28}{section.4.3}
\contentsline {section}{\numberline {4.4}Tests}{28}{section.4.4}
\contentsline {section}{\numberline {4.5}Comments}{29}{section.4.5}
\contentsline {section}{\numberline {4.6}Whitespace Control}{29}{section.4.6}
\contentsline {section}{\numberline {4.7}Escaping}{29}{section.4.7}
\contentsline {section}{\numberline {4.8}Line Statements}{30}{section.4.8}
\contentsline {section}{\numberline {4.9}Template Inheritance}{30}{section.4.9}
\contentsline {subsection}{\numberline {4.9.1}Base Template}{31}{subsection.4.9.1}
\contentsline {subsection}{\numberline {4.9.2}Child Template}{31}{subsection.4.9.2}
\contentsline {subsection}{\numberline {4.9.3}Super Blocks}{32}{subsection.4.9.3}
\contentsline {subsection}{\numberline {4.9.4}Named Block End-Tags}{32}{subsection.4.9.4}
\contentsline {subsection}{\numberline {4.9.5}Block Nesting and Scope}{32}{subsection.4.9.5}
\contentsline {subsection}{\numberline {4.9.6}Template Objects}{33}{subsection.4.9.6}
\contentsline {section}{\numberline {4.10}HTML Escaping}{33}{section.4.10}
\contentsline {subsection}{\numberline {4.10.1}Working with Manual Escaping}{33}{subsection.4.10.1}
\contentsline {subsection}{\numberline {4.10.2}Working with Automatic Escaping}{33}{subsection.4.10.2}
\contentsline {section}{\numberline {4.11}List of Control Structures}{33}{section.4.11}
\contentsline {subsection}{\numberline {4.11.1}For}{34}{subsection.4.11.1}
\contentsline {subsection}{\numberline {4.11.2}If}{35}{subsection.4.11.2}
\contentsline {subsection}{\numberline {4.11.3}Macros}{35}{subsection.4.11.3}
\contentsline {subsection}{\numberline {4.11.4}Call}{36}{subsection.4.11.4}
\contentsline {subsection}{\numberline {4.11.5}Filters}{36}{subsection.4.11.5}
\contentsline {subsection}{\numberline {4.11.6}Assignments}{37}{subsection.4.11.6}
\contentsline {subsection}{\numberline {4.11.7}Extends}{37}{subsection.4.11.7}
\contentsline {subsection}{\numberline {4.11.8}Block}{37}{subsection.4.11.8}
\contentsline {subsection}{\numberline {4.11.9}Include}{37}{subsection.4.11.9}
\contentsline {subsection}{\numberline {4.11.10}Import}{38}{subsection.4.11.10}
\contentsline {section}{\numberline {4.12}Import Context Behavior}{38}{section.4.12}
\contentsline {section}{\numberline {4.13}Expressions}{39}{section.4.13}
\contentsline {subsection}{\numberline {4.13.1}Literals}{39}{subsection.4.13.1}
\contentsline {subsection}{\numberline {4.13.2}Math}{40}{subsection.4.13.2}
\contentsline {subsection}{\numberline {4.13.3}Comparisons}{40}{subsection.4.13.3}
\contentsline {subsection}{\numberline {4.13.4}Logic}{40}{subsection.4.13.4}
\contentsline {subsection}{\numberline {4.13.5}Other Operators}{40}{subsection.4.13.5}
\contentsline {subsection}{\numberline {4.13.6}If Expression}{41}{subsection.4.13.6}
\contentsline {section}{\numberline {4.14}List of Builtin Filters}{41}{section.4.14}
\contentsline {section}{\numberline {4.15}List of Builtin Tests}{45}{section.4.15}
\contentsline {section}{\numberline {4.16}List of Global Functions}{46}{section.4.16}
\contentsline {section}{\numberline {4.17}Extensions}{48}{section.4.17}
\contentsline {subsection}{\numberline {4.17.1}i18n}{48}{subsection.4.17.1}
\contentsline {subsection}{\numberline {4.17.2}Expression Statement}{49}{subsection.4.17.2}
\contentsline {subsection}{\numberline {4.17.3}Loop Controls}{49}{subsection.4.17.3}
\contentsline {subsection}{\numberline {4.17.4}With Statement}{49}{subsection.4.17.4}
\contentsline {section}{\numberline {4.18}Autoescape Extension}{49}{section.4.18}
\contentsline {chapter}{\numberline {5}Extensions}{51}{chapter.5}
\contentsline {section}{\numberline {5.1}Adding Extensions}{51}{section.5.1}
\contentsline {section}{\numberline {5.2}i18n Extension}{51}{section.5.2}
\contentsline {subsection}{\numberline {5.2.1}Environment Methods}{51}{subsection.5.2.1}
\contentsline {subsection}{\numberline {5.2.2}Newstyle Gettext}{52}{subsection.5.2.2}
\contentsline {section}{\numberline {5.3}Expression Statement}{53}{section.5.3}
\contentsline {section}{\numberline {5.4}Loop Controls}{53}{section.5.4}
\contentsline {section}{\numberline {5.5}With Statement}{53}{section.5.5}
\contentsline {section}{\numberline {5.6}Autoescape Extension}{53}{section.5.6}
\contentsline {section}{\numberline {5.7}Writing Extensions}{53}{section.5.7}
\contentsline {subsection}{\numberline {5.7.1}Example Extension}{53}{subsection.5.7.1}
\contentsline {subsection}{\numberline {5.7.2}Extension API}{55}{subsection.5.7.2}
\contentsline {subsection}{\numberline {5.7.3}Parser API}{56}{subsection.5.7.3}
\contentsline {subsection}{\numberline {5.7.4}AST}{57}{subsection.5.7.4}
\contentsline {chapter}{\numberline {6}Integration}{65}{chapter.6}
\contentsline {section}{\numberline {6.1}Babel Integration}{65}{section.6.1}
\contentsline {section}{\numberline {6.2}Pylons}{65}{section.6.2}
\contentsline {section}{\numberline {6.3}TextMate}{66}{section.6.3}
\contentsline {section}{\numberline {6.4}Vim}{66}{section.6.4}
\contentsline {chapter}{\numberline {7}Switching from other Template Engines}{67}{chapter.7}
\contentsline {section}{\numberline {7.1}Jinja1}{67}{section.7.1}
\contentsline {subsection}{\numberline {7.1.1}API}{67}{subsection.7.1.1}
\contentsline {subsection}{\numberline {7.1.2}Templates}{68}{subsection.7.1.2}
\contentsline {section}{\numberline {7.2}Django}{68}{section.7.2}
\contentsline {subsection}{\numberline {7.2.1}Method Calls}{68}{subsection.7.2.1}
\contentsline {subsection}{\numberline {7.2.2}Conditions}{68}{subsection.7.2.2}
\contentsline {subsection}{\numberline {7.2.3}Filter Arguments}{69}{subsection.7.2.3}
\contentsline {subsection}{\numberline {7.2.4}Tests}{69}{subsection.7.2.4}
\contentsline {subsection}{\numberline {7.2.5}Loops}{69}{subsection.7.2.5}
\contentsline {subsection}{\numberline {7.2.6}Cycle}{69}{subsection.7.2.6}
\contentsline {section}{\numberline {7.3}Mako}{70}{section.7.3}
\contentsline {chapter}{\numberline {8}Tips and Tricks}{71}{chapter.8}
\contentsline {section}{\numberline {8.1}Null-Master Fallback}{71}{section.8.1}
\contentsline {section}{\numberline {8.2}Alternating Rows}{71}{section.8.2}
\contentsline {section}{\numberline {8.3}Highlighting Active Menu Items}{71}{section.8.3}
\contentsline {section}{\numberline {8.4}Accessing the parent Loop}{72}{section.8.4}
\contentsline {chapter}{\numberline {9}Frequently Asked Questions}{73}{chapter.9}
\contentsline {section}{\numberline {9.1}Why is it called Jinja?}{73}{section.9.1}
\contentsline {section}{\numberline {9.2}How fast is it?}{73}{section.9.2}
\contentsline {section}{\numberline {9.3}How Compatible is Jinja2 with Django?}{73}{section.9.3}
\contentsline {section}{\numberline {9.4}Isn't it a terrible idea to put Logic into Templates?}{74}{section.9.4}
\contentsline {section}{\numberline {9.5}Why is Autoescaping not the Default?}{74}{section.9.5}
\contentsline {section}{\numberline {9.6}Why is the Context immutable?}{74}{section.9.6}
\contentsline {section}{\numberline {9.7}What is the speedups module and why is it missing?}{75}{section.9.7}
\contentsline {section}{\numberline {9.8}My tracebacks look weird. What's happening?}{75}{section.9.8}
\contentsline {section}{\numberline {9.9}Why is there no Python 2.3 support?}{75}{section.9.9}
\contentsline {section}{\numberline {9.10}My Macros are overriden by something}{75}{section.9.10}
\contentsline {chapter}{\numberline {10}Jinja2 Changelog}{77}{chapter.10}
\contentsline {section}{\numberline {10.1}Version 2.5.3}{77}{section.10.1}
\contentsline {section}{\numberline {10.2}Version 2.5.2}{77}{section.10.2}
\contentsline {section}{\numberline {10.3}Version 2.5.1}{77}{section.10.3}
\contentsline {section}{\numberline {10.4}Version 2.5}{77}{section.10.4}
\contentsline {section}{\numberline {10.5}Version 2.4.1}{78}{section.10.5}
\contentsline {section}{\numberline {10.6}Version 2.4}{78}{section.10.6}
\contentsline {section}{\numberline {10.7}Version 2.3.1}{78}{section.10.7}
\contentsline {section}{\numberline {10.8}Version 2.3}{78}{section.10.8}
\contentsline {section}{\numberline {10.9}Version 2.2.1}{79}{section.10.9}
\contentsline {section}{\numberline {10.10}Version 2.2}{79}{section.10.10}
\contentsline {section}{\numberline {10.11}Version 2.1.1}{79}{section.10.11}
\contentsline {section}{\numberline {10.12}Version 2.1}{79}{section.10.12}
\contentsline {section}{\numberline {10.13}Version 2.0}{80}{section.10.13}
\contentsline {section}{\numberline {10.14}Version 2.0rc1}{80}{section.10.14}
