Skip to content
Myr

Documentation update. Documentation will become the new Jinja2 website

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 0e7b9f0 · Browse files · 4 files+113 added−57 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+113 added−57 removed

  • other:+113 added−57 removed

4 files+113 added−57 removed

modified:docs/index.rst+34 added-5 removed
1Jinja2 Documentation2====================1Welcome to Jinja22=================34This is the documentation for the Jinja2 general purpose templating language.5Jinja2 is a library for Python 2.4 and onwards that is designed to be flexible,6fast and secure.4Jinja2 is a modern and designer friendly templating language for Python,5modelled after Django's templates. It is fast, widely used and secure6with the optional sandboxed template execution environment:78.. sourcecode:: html+jinja910 <title>{% block title %}{% endblock %}</title>11 <ul>12 {% for user in users %}13 <li><a href="{{ user.url }}">{{ user.username }}</a></li>14 {% endfor %}15 </ul>1617**Features:**1819- sandboxed execution20- powerful automatic HTML escaping system for XSS prevention21- template inheritance22- compiles down to the optimal python code just in time23- optional ahead of time template compilation24- easy to debug. Line numbers of exceptions directly point to25 the correct line in the template.26- configurable syntax2728Jinja2 Documentation29--------------------3031.. toctree::32 :maxdepth: 23334 intro
4 unmodified lines
39 integration40 switching41 tricks4243Additional Information44----------------------4546.. toctree::47 :maxdepth: 24849 faq50 changelog5152If you can't find the information you're looking for, have a look at the
4 unmodified lines
modified:docs/intro.rst-19 removed
8 unmodified lines
9Django, you should feel right at home with Jinja2. It's both designer and10developer friendly by sticking to Python's principles and adding functionality11useful for templating environments.1213The key-features are...1415- ... **configurable syntax**. If you are generating LaTeX or other formats16 with Jinja2 you can change the delimiters to something that integrates better17 into the LaTeX markup.1819- ... **fast**. While performance is not the primarily target of Jinja2 it's20 surprisingly fast. The overhead compared to regular Python code was reduced21 to the very minimum.2223- ... **easy to debug**. Jinja2 integrates directly into the python traceback24 system which allows you to debug Jinja2 templates with regular python25 debugging helpers.2627- ... **secure**. It's possible to evaluate untrusted template code if the28 optional sandbox is enabled. This allows Jinja2 to be used as templating29 language for applications where users may modify the template design.303113Prerequisites14-------------1516Jinja2 needs at least **Python 2.4** to run. Additionally a working C-compiler
133 unmodified lines
modified:docs/Makefile+76 added-33 removed
3 unmodified lines
4# You can set these variables from the command line.5SPHINXOPTS =6SPHINXBUILD = sphinx-build7PAPER =8BUILDDIR = _build910# Internal variables.11PAPEROPT_a4 = -D latex_paper_size=a412PAPEROPT_letter = -D latex_paper_size=letter12ALLSPHINXOPTS = -d _build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .13ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .1414.PHONY: help clean html web pickle htmlhelp latex changes linkcheck15.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp epub latex changes linkcheck doctest1617help:18 @echo "Please use \`make <target>' where <target> is one of"18 @echo " html to make standalone HTML files"19 @echo " pickle to make pickle files"20 @echo " json to make JSON files"21 @echo " htmlhelp to make HTML files and a HTML help project"22 @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"23 @echo " changes to make an overview over all changed/added/deprecated items"24 @echo " linkcheck to check all external links for integrity"19 @echo " html to make standalone HTML files"20 @echo " dirhtml to make HTML files named index.html in directories"21 @echo " singlehtml to make a single large HTML file"22 @echo " pickle to make pickle files"23 @echo " json to make JSON files"24 @echo " htmlhelp to make HTML files and a HTML help project"25 @echo " qthelp to make HTML files and a qthelp project"26 @echo " devhelp to make HTML files and a Devhelp project"27 @echo " epub to make an epub"28 @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"29 @echo " latexpdf to make LaTeX files and run them through pdflatex"30 @echo " changes to make an overview of all changed/added/deprecated items"31 @echo " linkcheck to check all external links for integrity"32 @echo " doctest to run all doctests embedded in the documentation (if enabled)"3334clean:27 -rm -rf _build/*35 -rm -rf $(BUILDDIR)/*3637html:30 mkdir -p _build/html _build/doctrees31 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) _build/html38 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html39 @echo33 @echo "Build finished. The HTML pages are in _build/html."40 @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."4142dirhtml:43 $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml44 @echo45 @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."4647singlehtml:48 $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml49 @echo50 @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."5152pickle:36 mkdir -p _build/pickle _build/doctrees37 $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) _build/pickle53 $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle54 @echo39 @echo "Build finished; now you can process the pickle files"55 @echo "Build finished; now you can process the pickle files."5657json:42 mkdir -p _build/json _build/doctrees43 $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) _build/json58 $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json59 @echo45 @echo "Build finished; now you can process the json files"60 @echo "Build finished; now you can process the JSON files."6147web: pickle4862htmlhelp:50 mkdir -p _build/htmlhelp _build/doctrees51 $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) _build/htmlhelp63 $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp64 @echo65 @echo "Build finished; now you can run HTML Help Workshop with the" \54 ".hhp project file in _build/htmlhelp."66 ".hhp project file in $(BUILDDIR)/htmlhelp."6768qthelp:69 $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp70 @echo71 @echo "Build finished; now you can run "qcollectiongenerator" with the" \72 ".qhcp project file in $(BUILDDIR)/qthelp, like this:"73 @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Flask.qhcp"74 @echo "To view the help file:"75 @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Flask.qhc"7677devhelp:78 $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) _build/devhelp79 @echo80 @echo "Build finished."81 @echo "To view the help file:"82 @echo "# mkdir -p $$HOME/.local/share/devhelp/Flask"83 @echo "# ln -s _build/devhelp $$HOME/.local/share/devhelp/Flask"84 @echo "# devhelp"8586epub:87 $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub88 @echo89 @echo "Build finished. The epub file is in $(BUILDDIR)/epub."9091latex:57 mkdir -p _build/latex _build/doctrees58 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) _build/latex92 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex93 @echo60 @echo "Build finished; the LaTeX files are in _build/latex."94 @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."95 @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \96 "run these through (pdf)latex."9798latexpdf: latex99 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) _build/latex100 @echo "Running LaTeX files through pdflatex..."101 make -C _build/latex all-pdf102 @echo "pdflatex finished; the PDF files are in _build/latex."103104changes:65 mkdir -p _build/changes _build/doctrees66 $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) _build/changes105 $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes106 @echo68 @echo "The overview file is in _build/changes."107 @echo "The overview file is in $(BUILDDIR)/changes."108109linkcheck:71 mkdir -p _build/linkcheck _build/doctrees72 $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) _build/linkcheck110 $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck111 @echo112 @echo "Link check complete; look for any errors in the above output " \75 "or in _build/linkcheck/output.txt."113 "or in $(BUILDDIR)/linkcheck/output.txt."114115doctest:116 $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest117 @echo "Testing of doctests in the sources finished, look at the " \118 "results in $(BUILDDIR)/doctest/output.txt."
modified:Makefile+3 added
1test:2 python setup.py test34website:5 $(MAKE) -C docs dirhtml SPHINXOPTS=-Awebsite=167.PHONY: test