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
Provenance
- Commit
d6a2003- Tree
7b50165- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
0e7b9f0
4 files changed+113 added−57 removed
modified:docs/index.rst+34 added-5 removed
1-Jinja2 Documentation2-====================1+Welcome to Jinja22+=================3 4-This is the documentation for the Jinja2 general purpose templating language.5-Jinja2 is a library for Python 2.4 and onwards that is designed to be flexible,6-fast and secure.4+Jinja2 is a modern and designer friendly templating language for Python,5+modelled after Django's templates. It is fast, widely used and secure6+with the optional sandboxed template execution environment:7 8+.. sourcecode:: html+jinja9+10+ <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>16+17+**Features:**18+19+- 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 syntax27+28+Jinja2 Documentation29+--------------------30+31 .. toctree::32 :maxdepth: 233 34 intro4 unmodified lines39 integration40 switching41 tricks42 43+Additional Information44+----------------------45+46+.. toctree::47+ :maxdepth: 248+49 faq50 changelog51 52 If you can't find the information you're looking for, have a look at the4 unmodified linesmodified:docs/intro.rst-19 removed
8 unmodified lines9 Django, you should feel right at home with Jinja2. It's both designer and10 developer friendly by sticking to Python's principles and adding functionality11 useful for templating environments.12 13-The key-features are...14-15-- ... **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.18-19-- ... **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.22-23-- ... **easy to debug**. Jinja2 integrates directly into the python traceback24- system which allows you to debug Jinja2 templates with regular python25- debugging helpers.26-27-- ... **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.30-31-13 Prerequisites14 -------------15 16 Jinja2 needs at least **Python 2.4** to run. Additionally a working C-compiler133 unmodified linesmodified:docs/Makefile+76 added-33 removed
3 unmodified lines4 # You can set these variables from the command line.5 SPHINXOPTS =6 SPHINXBUILD = sphinx-build7 PAPER =8+BUILDDIR = _build9 10 # Internal variables.11 PAPEROPT_a4 = -D latex_paper_size=a412 PAPEROPT_letter = -D latex_paper_size=letter12-ALLSPHINXOPTS = -d _build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .13+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .14 14-.PHONY: help clean html web pickle htmlhelp latex changes linkcheck15+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp epub latex changes linkcheck doctest16 17 help: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)"33 34 clean:27- -rm -rf _build/*35+ -rm -rf $(BUILDDIR)/*36 37 html: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."41 42+dirhtml:43+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml44+ @echo45+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."46+47+singlehtml:48+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml49+ @echo50+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."51+52 pickle: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."56 57 json: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."61 47-web: pickle48-62 htmlhelp: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."67 68+qthelp: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"76+77+devhelp: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"85+86+epub:87+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub88+ @echo89+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."90+91 latex: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."97 98+latexpdf: 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."103+104 changes: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."108 109 linkcheck: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."114+115+doctest: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
1 test:2 python setup.py test3 4+website:5+ $(MAKE) -C docs dirhtml SPHINXOPTS=-Awebsite=16+7 .PHONY: test