From f77b09d998dffe6b8332f958db970992bd451444 Mon Sep 17 00:00:00 2001 From: David Lord Date: Wed, 24 Jul 2019 14:18:02 -0700 Subject: [PATCH] modernize docs config, use pallets-sphinx-themes --- CHANGES => CHANGES.rst | 3 +- docs/Makefile | 117 +----- docs/_build/.ignore | 0 docs/_static/.ignore | 0 ...jinja-small.png => jinja-logo-sidebar.png} | Bin docs/_static/jinja-logo.png | Bin 0 -> 12854 bytes docs/_templates/sidebarintro.html | 20 - docs/_templates/sidebarlogo.html | 3 - docs/_themes/LICENSE | 37 -- docs/_themes/README | 31 -- docs/_themes/jinja/layout.html | 8 - docs/_themes/jinja/relations.html | 19 - docs/_themes/jinja/static/jinja.css_t | 396 ------------------ docs/_themes/jinja/theme.conf | 3 - docs/api.rst | 6 +- docs/cache_extension.py | 2 +- docs/changelog.rst | 5 +- docs/conf.py | 196 ++------- docs/contents.rst.inc | 23 - docs/extensions.rst | 8 +- docs/index.rst | 32 +- docs/jinjaext.py | 194 --------- docs/jinjastyle.sty | 119 ------ docs/latexindex.rst | 6 - docs/logo.pdf | Bin 5677 -> 0 bytes docs/make.bat | 35 ++ docs/requirements.txt | 4 + docs/templates.rst | 17 +- jinja2/lexer.py | 5 +- scripts/make-release.py | 2 +- 30 files changed, 142 insertions(+), 1149 deletions(-) rename CHANGES => CHANGES.rst (99%) delete mode 100644 docs/_build/.ignore delete mode 100644 docs/_static/.ignore rename docs/_static/{jinja-small.png => jinja-logo-sidebar.png} (100%) create mode 100644 docs/_static/jinja-logo.png delete mode 100644 docs/_templates/sidebarintro.html delete mode 100644 docs/_templates/sidebarlogo.html delete mode 100644 docs/_themes/LICENSE delete mode 100644 docs/_themes/README delete mode 100644 docs/_themes/jinja/layout.html delete mode 100644 docs/_themes/jinja/relations.html delete mode 100644 docs/_themes/jinja/static/jinja.css_t delete mode 100644 docs/_themes/jinja/theme.conf delete mode 100644 docs/contents.rst.inc delete mode 100644 docs/jinjaext.py delete mode 100644 docs/jinjastyle.sty delete mode 100644 docs/latexindex.rst delete mode 100644 docs/logo.pdf create mode 100644 docs/make.bat create mode 100644 docs/requirements.txt diff --git a/CHANGES b/CHANGES.rst similarity index 99% rename from CHANGES rename to CHANGES.rst index 7e5df3dd..241136b3 100644 --- a/CHANGES +++ b/CHANGES.rst @@ -1,5 +1,4 @@ -Jinja2 Changelog -================ +.. currentmodule:: jinja2 Version 2.9.7 ------------- diff --git a/docs/Makefile b/docs/Makefile index 52d78d9e..51285967 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,118 +1,19 @@ -# Makefile for Sphinx documentation +# Minimal makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build -PAPER = +SOURCEDIR = . BUILDDIR = _build -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp epub latex changes linkcheck doctest - +# Put it first so that "make" without argument is like "make help". help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -clean: - -rm -rf $(BUILDDIR)/* - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Flask.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Flask.qhc" - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) _build/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/Flask" - @echo "# ln -s _build/devhelp $$HOME/.local/share/devhelp/Flask" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ - "run these through (pdf)latex." - -latexpdf: latex - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) _build/latex - @echo "Running LaTeX files through pdflatex..." - make -C _build/latex all-pdf - @echo "pdflatex finished; the PDF files are in _build/latex." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." +.PHONY: help Makefile -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/_build/.ignore b/docs/_build/.ignore deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/_static/.ignore b/docs/_static/.ignore deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/_static/jinja-small.png b/docs/_static/jinja-logo-sidebar.png similarity index 100% rename from docs/_static/jinja-small.png rename to docs/_static/jinja-logo-sidebar.png diff --git a/docs/_static/jinja-logo.png b/docs/_static/jinja-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..7f8ca5bbde1ee0969678737896a2c19f0a7b073a GIT binary patch literal 12854 zc-pmk^;cX^@Z~VLI|R4jg9LYX_Y4FXf8$LRrp zH;<|cvIaipM|qe&hW*RW9WAc+bG0WeqTt`5nd*N_?+Ff?WBp?mc+zeL(;GS4_sePBJroHs6|Z8g&H*l~@HM7$G6 zSM}K;s+(El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&L%A9ba^*ip%fXxLXo!YCL$KYss@RtjG$PwbMI zFVIyLsD_@3lB{-u&VdV#wx$htt9HuCujR20o$Yw>-5TTIztcCq-&?E!s-}?sH(CTo z=VigMSV;|$b#7Tvo36u6fec=HVtIBidiNqUW2N1IhSE wxw}0About Jinja2 -

- Jinja2 is a full featured template engine for Python. It has full unicode - support, an optional integrated sandboxed execution environment, widely used - and BSD licensed. -

-

Other Formats

-

- You can download the documentation in other formats as well: -

- -

Useful Links

- diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html deleted file mode 100644 index ca211c6a..00000000 --- a/docs/_templates/sidebarlogo.html +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/docs/_themes/LICENSE b/docs/_themes/LICENSE deleted file mode 100644 index 8daab7ee..00000000 --- a/docs/_themes/LICENSE +++ /dev/null @@ -1,37 +0,0 @@ -Copyright (c) 2010 by Armin Ronacher. - -Some rights reserved. - -Redistribution and use in source and binary forms of the theme, with or -without modification, are permitted provided that the following conditions -are met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - -* The names of the contributors may not be used to endorse or - promote products derived from this software without specific - prior written permission. - -We kindly ask you to only use these themes in an unmodified manner just -for Flask and Flask-related products, not for unrelated projects. If you -like the visual style and want to use it for your own projects, please -consider making some larger changes to the themes (such as changing -font faces, sizes, colors or margins). - -THIS THEME IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS THEME, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/docs/_themes/README b/docs/_themes/README deleted file mode 100644 index b3292bdf..00000000 --- a/docs/_themes/README +++ /dev/null @@ -1,31 +0,0 @@ -Flask Sphinx Styles -=================== - -This repository contains sphinx styles for Flask and Flask related -projects. To use this style in your Sphinx documentation, follow -this guide: - -1. put this folder as _themes into your docs folder. Alternatively - you can also use git submodules to check out the contents there. -2. add this to your conf.py: - - sys.path.append(os.path.abspath('_themes')) - html_theme_path = ['_themes'] - html_theme = 'flask' - -The following themes exist: - -- 'flask' - the standard flask documentation theme for large - projects -- 'flask_small' - small one-page theme. Intended to be used by - very small addon libraries for flask. - -The following options exist for the flask_small theme: - - [options] - index_logo = '' filename of a picture in _static - to be used as replacement for the - h1 in the index.rst file. - index_logo_height = 120px height of the index logo - github_fork = '' repository name on github for the - "fork me" badge diff --git a/docs/_themes/jinja/layout.html b/docs/_themes/jinja/layout.html deleted file mode 100644 index a0c9cab0..00000000 --- a/docs/_themes/jinja/layout.html +++ /dev/null @@ -1,8 +0,0 @@ -{%- extends "basic/layout.html" %} -{%- block relbar2 %}{% endblock %} -{%- block footer %} - -{%- endblock %} diff --git a/docs/_themes/jinja/relations.html b/docs/_themes/jinja/relations.html deleted file mode 100644 index 3bbcde85..00000000 --- a/docs/_themes/jinja/relations.html +++ /dev/null @@ -1,19 +0,0 @@ -

Related Topics

- diff --git a/docs/_themes/jinja/static/jinja.css_t b/docs/_themes/jinja/static/jinja.css_t deleted file mode 100644 index 3291ba6f..00000000 --- a/docs/_themes/jinja/static/jinja.css_t +++ /dev/null @@ -1,396 +0,0 @@ -/* - * jinja.css_t - * ~~~~~~~~~~~ - * - * :copyright: Copyright 2011 by Armin Ronacher. - * :license: Flask Design License, see LICENSE for details. - */ - -@import url(http://fonts.googleapis.com/css?family=Crimson+Text); - -{% set page_width = '940px' %} -{% set sidebar_width = '220px' %} -{% set font_family = 'Georgia, serif' %} -{% set header_font_family = 'Crimson Text, ' ~ font_family %} - -@import url("basic.css"); - -/* -- page layout ----------------------------------------------------------- */ - -body { - font-family: {{ font_family }}; - font-size: 17px; - background-color: white; - color: #000; - margin: 0; - padding: 0; -} - -div.document { - width: {{ page_width }}; - margin: 30px auto 0 auto; -} - -div.documentwrapper { - float: left; - width: 100%; -} - -div.bodywrapper { - margin: 0 0 0 {{ sidebar_width }}; -} - -div.sphinxsidebar { - width: {{ sidebar_width }}; -} - -hr { - border: 1px solid #B1B4B6; -} - -div.body { - background-color: #ffffff; - color: #3E4349; - padding: 0 30px 0 30px; -} - -img.floatingflask { - padding: 0 0 10px 10px; - float: right; -} - -div.footer { - width: {{ page_width }}; - margin: 20px auto 30px auto; - font-size: 14px; - color: #888; - text-align: right; -} - -div.footer a { - color: #888; -} - -div.related { - display: none; -} - -div.sphinxsidebar a { - color: #444; - text-decoration: none; - border-bottom: 1px dotted #999; -} - -div.sphinxsidebar a:hover { - border-bottom: 1px solid #999; -} - -div.sphinxsidebar { - font-size: 15px; - line-height: 1.5; -} - -div.sphinxsidebarwrapper { - padding: 18px 10px; -} - -div.sphinxsidebarwrapper p.logo { - padding: 0 0 20px 0; - margin: 0; - text-align: center; -} - -div.sphinxsidebar h3, -div.sphinxsidebar h4 { - font-family: {{ font_family }}; - color: #444; - font-size: 24px; - font-weight: normal; - margin: 0 0 5px 0; - padding: 0; -} - -div.sphinxsidebar h4 { - font-size: 20px; -} - -div.sphinxsidebar h3 a { - color: #444; -} - -div.sphinxsidebar p.logo a, -div.sphinxsidebar h3 a, -div.sphinxsidebar p.logo a:hover, -div.sphinxsidebar h3 a:hover { - border: none; -} - -div.sphinxsidebar p { - color: #555; - margin: 10px 0; -} - -div.sphinxsidebar ul { - margin: 10px 0; - padding: 0; - color: #000; -} - -div.sphinxsidebar input { - border: 1px solid #ccc; - font-family: {{ font_family }}; - font-size: 14px; -} - -div.sphinxsidebar form.search input[name="q"] { - width: 130px; -} - -/* -- body styles ----------------------------------------------------------- */ - -a { - color: #aa0000; - text-decoration: underline; -} - -a:hover { - color: #dd0000; - text-decoration: underline; -} - -div.body h1, -div.body h2, -div.body h3, -div.body h4, -div.body h5, -div.body h6 { - font-family: {{ header_font_family }}; - font-weight: normal; - margin: 30px 0px 10px 0px; - padding: 0; - color: black; -} - -div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; } -div.body h2 { font-size: 180%; } -div.body h3 { font-size: 150%; } -div.body h4 { font-size: 130%; } -div.body h5 { font-size: 100%; } -div.body h6 { font-size: 100%; } - -a.headerlink { - color: #ddd; - padding: 0 4px; - text-decoration: none; -} - -a.headerlink:hover { - color: #444; - background: #eaeaea; -} - -div.body p, div.body dd, div.body li { - line-height: 1.4em; -} - -div.admonition { - background: #fafafa; - margin: 20px -30px; - padding: 10px 30px; - border-top: 1px solid #ccc; - border-bottom: 1px solid #ccc; -} - -div.admonition tt.xref, div.admonition a tt { - border-bottom: 1px solid #fafafa; -} - -dd div.admonition { - margin-left: -60px; - padding-left: 60px; -} - -div.admonition p.admonition-title { - font-family: {{ font_family }}; - font-weight: normal; - font-size: 24px; - margin: 0 0 10px 0; - padding: 0; - line-height: 1; -} - -div.admonition p.last { - margin-bottom: 0; -} - -div.highlight { - background-color: white; -} - -dt:target, .highlight { - background: #FAF3E8; -} - -div.note { - background-color: #eee; - border: 1px solid #ccc; -} - -div.seealso { - background-color: #ffc; - border: 1px solid #ff6; -} - -div.topic { - background-color: #eee; -} - -p.admonition-title { - display: inline; -} - -p.admonition-title:after { - content: ":"; -} - -pre, tt { - font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; - font-size: 0.85em; -} - -img.screenshot { -} - -tt.descname, tt.descclassname { - font-size: 0.95em; -} - -tt.descname { - padding-right: 0.08em; -} - -img.screenshot { - -moz-box-shadow: 2px 2px 4px #eee; - -webkit-box-shadow: 2px 2px 4px #eee; - box-shadow: 2px 2px 4px #eee; -} - -table.docutils { - border: 1px solid #888; - -moz-box-shadow: 2px 2px 4px #eee; - -webkit-box-shadow: 2px 2px 4px #eee; - box-shadow: 2px 2px 4px #eee; -} - -table.docutils td, table.docutils th { - border: 1px solid #888; - padding: 0.25em 0.7em; -} - -table.field-list, table.footnote { - border: none; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; -} - -table.footnote { - margin: 15px 0; - width: 100%; - border: 1px solid #eee; - background: #fdfdfd; - font-size: 0.9em; -} - -table.footnote + table.footnote { - margin-top: -15px; - border-top: none; -} - -table.field-list th { - padding: 0 0.8em 0 0; -} - -table.field-list td { - padding: 0; -} - -table.footnote td.label { - width: 0px; - padding: 0.3em 0 0.3em 0.5em; -} - -table.footnote td { - padding: 0.3em 0.5em; -} - -dl { - margin: 0; - padding: 0; -} - -dl dd { - margin-left: 30px; -} - -blockquote { - margin: 0 0 0 30px; - padding: 0; -} - -ul, ol { - margin: 10px 0 10px 30px; - padding: 0; -} - -pre { - background: #eee; - padding: 7px 30px; - margin: 15px -30px; - line-height: 1.3em; -} - -dl pre, blockquote pre, li pre { - margin-left: -60px; - padding-left: 60px; -} - -dl dl pre { - margin-left: -90px; - padding-left: 90px; -} - -tt { - background-color: #E8EFF0; - color: #222; - /* padding: 1px 2px; */ -} - -tt.xref, a tt { - background-color: #E8EFF0; - border-bottom: 1px solid white; -} - -a.reference { - text-decoration: none; - border-bottom: 1px dotted #bb0000; -} - -a.reference:hover { - border-bottom: 1px solid #dd0000; -} - -a.footnote-reference { - text-decoration: none; - font-size: 0.7em; - vertical-align: top; - border-bottom: 1px dotted #bb0000; -} - -a.footnote-reference:hover { - border-bottom: 1px solid #dd0000; -} - -a:hover tt { - background: #EEE; -} diff --git a/docs/_themes/jinja/theme.conf b/docs/_themes/jinja/theme.conf deleted file mode 100644 index 10c7e56e..00000000 --- a/docs/_themes/jinja/theme.conf +++ /dev/null @@ -1,3 +0,0 @@ -[theme] -inherit = basic -stylesheet = jinja.css diff --git a/docs/api.rst b/docs/api.rst index bbe6c366..fdd508d3 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -19,7 +19,7 @@ Even if you are creating templates from strings by using the constructor of albeit a shared one. Most applications will create one :class:`Environment` object on application -initialization and use that to load templates. In some cases however, it's +initialization and use that to load templates. In some cases however, it's useful to have multiple environments side by side, if different configurations are in use. @@ -213,7 +213,7 @@ useful if you want to dig deeper into Jinja2 or :ref:`develop extensions For a more complex example you can provide a hint. For example the :func:`first` filter creates an undefined object that way:: - return environment.undefined('no first item, sequence was empty') + return environment.undefined('no first item, sequence was empty') If it the `name` or `obj` is known (for example because an attribute was accessed) it should be passed to the undefined object, even if @@ -829,7 +829,7 @@ Here a simple test that checks if a variable is a prime number:: if n % i == 0: return False return True - + You can register it on the template environment by updating the :attr:`~Environment.tests` dict on the environment:: diff --git a/docs/cache_extension.py b/docs/cache_extension.py index ccdefa2f..992b5951 100644 --- a/docs/cache_extension.py +++ b/docs/cache_extension.py @@ -4,7 +4,7 @@ from jinja2.ext import Extension class FragmentCacheExtension(Extension): # a set of names that trigger the extension. - tags = set(['cache']) + tags = {'cache'} def __init__(self, environment): super(FragmentCacheExtension, self).__init__(environment) diff --git a/docs/changelog.rst b/docs/changelog.rst index 9f114842..218fe333 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,3 +1,4 @@ -.. module:: jinja2 +Changelog +========= -.. include:: ../CHANGES +.. include:: ../CHANGES.rst diff --git a/docs/conf.py b/docs/conf.py index 6e990be1..01e530dc 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,160 +1,52 @@ -# -*- coding: utf-8 -*- -# -# Jinja2 documentation build configuration file, created by -# sphinx-quickstart on Sun Apr 27 21:42:41 2008. -# -# This file is execfile()d with the current directory set to its containing dir. -# -# The contents of this file are pickled, so don't put values in the namespace -# that aren't pickleable (module imports are okay, they're removed automatically). -# -# All configuration values have a default value; values that are commented out -# serve to show the default value. +from pallets_sphinx_themes import get_version +from pallets_sphinx_themes import ProjectLink -import sys, os +# Project -------------------------------------------------------------- -# If your extensions are in another directory, add it here. If the directory -# is relative to the documentation root, use os.path.abspath to make it -# absolute, like shown here. -sys.path.append(os.path.dirname(os.path.abspath(__file__))) +project = "Jinja" +copyright = "2007 Pallets" +author = "Pallets" +release, version = get_version("Jinja2") -# General configuration -# --------------------- +# General -------------------------------------------------------------- -# Add any Sphinx extension module names here, as strings. They can be extensions -# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc', 'jinjaext'] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix of source filenames. -source_suffix = '.rst' - -# The master toctree document. -master_doc = 'index' - -# General substitutions. -project = 'Jinja2' -copyright = '2008, Armin Ronacher' - -# The default replacements for |version| and |release|, also used in various -# other places throughout the built documents. -# -# The short X.Y version. -import pkg_resources -try: - release = pkg_resources.get_distribution('Jinja2').version -except ImportError: - print 'To build the documentation, The distribution information of Jinja2' - print 'Has to be available. Either install the package into your' - print 'development environment or run "setup.py develop" to setup the' - print 'metadata. A virtualenv is recommended!' - sys.exit(1) -if 'dev' in release: - release = release.split('dev')[0] + 'dev' -version = '.'.join(release.split('.')[:2]) - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -#today = '' -# Else, today_fmt is used as the format for a strftime call. -today_fmt = '%B %d, %Y' - -# List of documents that shouldn't be included in the build. -#unused_docs = [] - -# If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -#add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -#show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'jinjaext.JinjaStyle' - - -# Options for HTML output -# ----------------------- - -html_theme = 'jinja' -html_theme_path = ['_themes'] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -#html_title = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -#html_use_smartypants = True - -# no modindex -html_use_modindex = False - -# If true, the reST sources are included in the HTML build as _sources/. -#html_copy_source = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. -#html_use_opensearch = False - -# Output file base name for HTML help builder. -htmlhelp_basename = 'Jinja2doc' - - -# Options for LaTeX output -# ------------------------ - -# The paper size ('letter' or 'a4'). -latex_paper_size = 'a4' - -# The font size ('10pt', '11pt' or '12pt'). -#latex_font_size = '10pt' - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, document class [howto/manual]). -latex_documents = [ - ('latexindex', 'Jinja2.tex', 'Jinja2 Documentation', 'Armin Ronacher', - 'manual'), +master_doc = "index" +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.intersphinx", + "pallets_sphinx_themes", + "sphinxcontrib.log_cabinet", + "sphinx_issues", ] - -# Additional stuff for LaTeX -latex_elements = { - 'fontpkg': r'\usepackage{mathpazo}', - 'papersize': 'a4paper', - 'pointsize': '12pt', - 'preamble': r''' -\usepackage{jinjastyle} - -% i hate you latex -\DeclareUnicodeCharacter{14D}{o} -''' +intersphinx_mapping = {"python": ("https://docs.python.org/3/", None)} +issues_github_path = "pallets/jinja" + +# HTML ----------------------------------------------------------------- + +html_theme = "jinja" +html_theme_options = {"index_sidebar_logo": False} +html_context = { + "project_links": [ + ProjectLink("Donate to Pallets", "https://palletsprojects.com/donate"), + ProjectLink("Jinja Website", "https://palletsprojects.com/p/jinja/"), + ProjectLink("PyPI releases", "https://pypi.org/project/Jinja2/"), + ProjectLink("Source Code", "https://github.com/pallets/jinja/"), + ProjectLink("Issue Tracker", "https://github.com/pallets/jinja/issues/"), + ] } - -latex_use_parts = True - -latex_additional_files = ['jinjastyle.sty', 'logo.pdf'] - -# If false, no module index is generated. -latex_use_modindex = False - html_sidebars = { - 'index': ['sidebarlogo.html', 'sidebarintro.html', 'sourcelink.html', - 'searchbox.html'], - '**': ['sidebarlogo.html', 'localtoc.html', 'relations.html', - 'sourcelink.html', 'searchbox.html'] + "index": ["project.html", "localtoc.html", "searchbox.html"], + "**": ["localtoc.html", "relations.html", "searchbox.html"], } +singlehtml_sidebars = {"index": ["project.html", "localtoc.html"]} +html_static_path = ["_static"] +html_favicon = "_static/jinja-logo-sidebar.png" +html_logo = "_static/jinja-logo-sidebar.png" +html_title = "Jinja Documentation ({})".format(version) +html_show_sourcelink = False + +# LaTeX ---------------------------------------------------------------- + +latex_documents = [ + (master_doc, "Jinja-{}.tex".format(version), html_title, author, "manual") +] diff --git a/docs/contents.rst.inc b/docs/contents.rst.inc deleted file mode 100644 index 7ee68703..00000000 --- a/docs/contents.rst.inc +++ /dev/null @@ -1,23 +0,0 @@ -Jinja2 Documentation --------------------- - -.. toctree:: - :maxdepth: 2 - - intro - api - sandbox - templates - extensions - integration - switching - tricks - -Additional Information ----------------------- - -.. toctree:: - :maxdepth: 2 - - faq - changelog diff --git a/docs/extensions.rst b/docs/extensions.rst index 635d1e4c..43ee2e27 100644 --- a/docs/extensions.rst +++ b/docs/extensions.rst @@ -27,8 +27,8 @@ i18n Extension **Import name:** `jinja2.ext.i18n` -The i18n extension can be used in combination with `gettext`_ or `babel`_. If -the i18n extension is enabled Jinja2 provides a `trans` statement that marks +The i18n extension can be used in combination with `gettext`_ or `babel`_. If +the i18n extension is enabled Jinja2 provides a `trans` statement that marks the wrapped string as translatable and calls `gettext`. After enabling, dummy `_` function that forwards calls to `gettext` is added @@ -294,7 +294,7 @@ extensions: The current :class:`~jinja2.lexer.TokenStream` .. autoclass:: jinja2.lexer.TokenStream - :members: push, look, eos, skip, next, next_if, skip_if, expect + :members: push, look, eos, skip, __next__, next_if, skip_if, expect .. attribute:: current @@ -336,6 +336,6 @@ For more information have a look at the repr of :meth:`jinja2.Environment.parse` .. module:: jinja2.nodes -.. jinjanodes:: +.. jinja:nodes:: jinja2.nodes.Node .. autoexception:: Impossible diff --git a/docs/index.rst b/docs/index.rst index a08d6281..616e5bf3 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,7 +1,13 @@ -Welcome to Jinja2 -================= +.. rst-class:: hide-header -Jinja2 is a modern and designer-friendly templating language for Python, +Jinja +===== + +.. image:: _static/jinja-logo.png + :align: center + :target: https://palletsprojects.com/p/jinja/ + +Jinja is a modern and designer-friendly templating language for Python, modelled after Django's templates. It is fast, widely used and secure with the optional sandboxed template execution environment: @@ -14,7 +20,7 @@ with the optional sandboxed template execution environment: {% endfor %} -**Features:** +Features: - sandboxed execution - powerful automatic HTML escaping system for XSS prevention @@ -25,10 +31,20 @@ with the optional sandboxed template execution environment: the correct line in the template. - configurable syntax -.. include:: contents.rst.inc - -If you can't find the information you're looking for, have a look at the -index or try to find it using the search function: +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + intro + api + sandbox + templates + extensions + integration + switching + tricks + faq + changelog * :ref:`genindex` * :ref:`search` diff --git a/docs/jinjaext.py b/docs/jinjaext.py deleted file mode 100644 index cdacba9d..00000000 --- a/docs/jinjaext.py +++ /dev/null @@ -1,194 +0,0 @@ -# -*- coding: utf-8 -*- -""" - Jinja Documentation Extensions - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Support for automatically documenting filters and tests. - - :copyright: Copyright 2008 by Armin Ronacher. - :license: BSD. -""" -import collections -import os -import re -import inspect -import jinja2 -from itertools import islice -from types import BuiltinFunctionType -from docutils import nodes -from docutils.statemachine import ViewList -from sphinx.ext.autodoc import prepare_docstring -from sphinx.application import TemplateBridge -from pygments.style import Style -from pygments.token import Keyword, Name, Comment, String, Error, \ - Number, Operator, Generic -from jinja2 import Environment, FileSystemLoader - - -def parse_rst(state, content_offset, doc): - node = nodes.section() - # hack around title style bookkeeping - surrounding_title_styles = state.memo.title_styles - surrounding_section_level = state.memo.section_level - state.memo.title_styles = [] - state.memo.section_level = 0 - state.nested_parse(doc, content_offset, node, match_titles=1) - state.memo.title_styles = surrounding_title_styles - state.memo.section_level = surrounding_section_level - return node.children - - -class JinjaStyle(Style): - title = 'Jinja Style' - default_style = "" - styles = { - Comment: 'italic #aaaaaa', - Comment.Preproc: 'noitalic #B11414', - Comment.Special: 'italic #505050', - - Keyword: 'bold #B80000', - Keyword.Type: '#808080', - - Operator.Word: 'bold #B80000', - - Name.Builtin: '#333333', - Name.Function: '#333333', - Name.Class: 'bold #333333', - Name.Namespace: 'bold #333333', - Name.Entity: 'bold #363636', - Name.Attribute: '#686868', - Name.Tag: 'bold #686868', - Name.Decorator: '#686868', - - String: '#AA891C', - Number: '#444444', - - Generic.Heading: 'bold #000080', - Generic.Subheading: 'bold #800080', - Generic.Deleted: '#aa0000', - Generic.Inserted: '#00aa00', - Generic.Error: '#aa0000', - Generic.Emph: 'italic', - Generic.Strong: 'bold', - Generic.Prompt: '#555555', - Generic.Output: '#888888', - Generic.Traceback: '#aa0000', - - Error: '#F00 bg:#FAA' - } - - -_sig_re = re.compile(r'^[a-zA-Z_][a-zA-Z0-9_]*(\(.*?\))') - - -def format_function(name, aliases, func): - lines = inspect.getdoc(func).splitlines() - signature = '()' - if isinstance(func, BuiltinFunctionType): - match = _sig_re.match(lines[0]) - if match is not None: - del lines[:1 + bool(lines and not lines[0])] - signature = match.group(1) - else: - try: - argspec = inspect.getargspec(func) - if getattr(func, 'environmentfilter', False) or \ - getattr(func, 'contextfilter', False) or \ - getattr(func, 'evalcontextfilter', False): - del argspec[0][0] - signature = inspect.formatargspec(*argspec) - except: - pass - result = ['.. function:: %s%s' % (name, signature), ''] - result.extend(' ' + line for line in lines) - if aliases: - result.extend(('', ' :aliases: %s' % ', '.join( - '``%s``' % x for x in sorted(aliases)))) - return result - - -def dump_functions(mapping): - def directive(dirname, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - reverse_mapping = {} - for name, func in mapping.items(): - reverse_mapping.setdefault(func, []).append(name) - filters = [] - for func, names in reverse_mapping.items(): - aliases = sorted(names, key=lambda x: len(x)) - name = aliases.pop() - filters.append((name, aliases, func)) - filters.sort() - - result = ViewList() - for name, aliases, func in filters: - for item in format_function(name, aliases, func): - result.append(item, '') - - node = nodes.paragraph() - state.nested_parse(result, content_offset, node) - return node.children - return directive - - -from jinja2.defaults import DEFAULT_FILTERS, DEFAULT_TESTS -jinja_filters = dump_functions(DEFAULT_FILTERS) -jinja_tests = dump_functions(DEFAULT_TESTS) - - -def jinja_nodes(dirname, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - from jinja2.nodes import Node - doc = ViewList() - def walk(node, indent): - p = ' ' * indent - sig = ', '.join(node.fields) - doc.append(p + '.. autoclass:: %s(%s)' % (node.__name__, sig), '') - if node.abstract: - members = [] - for key, name in node.__dict__.items(): - if not key.startswith('_') and \ - not hasattr(node.__base__, key) and isinstance(name, collections.Callable): - members.append(key) - if members: - members.sort() - doc.append('%s :members: %s' % (p, ', '.join(members)), '') - if node.__base__ != object: - doc.append('', '') - doc.append('%s :Node type: :class:`%s`' % - (p, node.__base__.__name__), '') - doc.append('', '') - children = node.__subclasses__() - children.sort(key=lambda x: x.__name__.lower()) - for child in children: - walk(child, indent) - walk(Node, 0) - return parse_rst(state, content_offset, doc) - - -def inject_toc(app, doctree, docname): - titleiter = iter(doctree.traverse(nodes.title)) - try: - # skip first title, we are not interested in that one - next(titleiter) - title = next(titleiter) - # and check if there is at least another title - next(titleiter) - except StopIteration: - return - tocnode = nodes.section('') - tocnode['classes'].append('toc') - toctitle = nodes.section('') - toctitle['classes'].append('toctitle') - toctitle.append(nodes.title(text='Table Of Contents')) - tocnode.append(toctitle) - tocnode += doctree.document.settings.env.get_toc_for(docname)[0][1] - title.parent.insert(title.parent.children.index(title), tocnode) - - -def setup(app): - app.add_directive('jinjafilters', jinja_filters, 0, (0, 0, 0)) - app.add_directive('jinjatests', jinja_tests, 0, (0, 0, 0)) - app.add_directive('jinjanodes', jinja_nodes, 0, (0, 0, 0)) - # uncomment for inline toc. links are broken unfortunately - ##app.connect('doctree-resolved', inject_toc) diff --git a/docs/jinjastyle.sty b/docs/jinjastyle.sty deleted file mode 100644 index da811ce3..00000000 --- a/docs/jinjastyle.sty +++ /dev/null @@ -1,119 +0,0 @@ -\definecolor{TitleColor}{rgb}{0,0,0} -\definecolor{InnerLinkColor}{rgb}{0,0,0} -\definecolor{OuterLinkColor}{rgb}{0.8,0,0} - -\renewcommand{\maketitle}{% - \begin{titlepage}% - \let\footnotesize\small - \let\footnoterule\relax - \ifsphinxpdfoutput - \begingroup - % This \def is required to deal with multi-line authors; it - % changes \\ to ', ' (comma-space), making it pass muster for - % generating document info in the PDF file. - \def\\{, } - \pdfinfo{ - /Author (\@author) - /Title (\@title) - } - \endgroup - \fi - \begin{flushright}% - %\sphinxlogo% - {\center - \vspace*{3cm} - \includegraphics{logo.pdf} - \vspace{3cm} - \par - {\rm\Huge \@title \par}% - {\em\LARGE \py@release\releaseinfo \par} - {\large - \@date \par - \py@authoraddress \par - }}% - \end{flushright}%\par - \@thanks - \end{titlepage}% - \cleardoublepage% - \setcounter{footnote}{0}% - \let\thanks\relax\let\maketitle\relax - %\gdef\@thanks{}\gdef\@author{}\gdef\@title{} -} - -\fancypagestyle{normal}{ - \fancyhf{} - \fancyfoot[LE,RO]{{\thepage}} - \fancyfoot[LO]{{\nouppercase{\rightmark}}} - \fancyfoot[RE]{{\nouppercase{\leftmark}}} - \fancyhead[LE,RO]{{ \@title, \py@release}} - \renewcommand{\headrulewidth}{0.4pt} - \renewcommand{\footrulewidth}{0.4pt} -} - -\fancypagestyle{plain}{ - \fancyhf{} - \fancyfoot[LE,RO]{{\thepage}} - \renewcommand{\headrulewidth}{0pt} - \renewcommand{\footrulewidth}{0.4pt} -} - -\titleformat{\section}{\Large}% - {\py@TitleColor\thesection}{0.5em}{\py@TitleColor}{\py@NormalColor} -\titleformat{\subsection}{\large}% - {\py@TitleColor\thesubsection}{0.5em}{\py@TitleColor}{\py@NormalColor} -\titleformat{\subsubsection}{}% - {\py@TitleColor\thesubsubsection}{0.5em}{\py@TitleColor}{\py@NormalColor} -\titleformat{\paragraph}{\large}% - {\py@TitleColor}{0em}{\py@TitleColor}{\py@NormalColor} - -\ChNameVar{\raggedleft\normalsize} -\ChNumVar{\raggedleft \bfseries\Large} -\ChTitleVar{\raggedleft \rm\Huge} - -\renewcommand\thepart{\@Roman\c@part} -\renewcommand\part{% - \pagestyle{plain} - \if@noskipsec \leavevmode \fi - \cleardoublepage - \vspace*{6cm}% - \@afterindentfalse - \secdef\@part\@spart} - -\def\@part[#1]#2{% - \ifnum \c@secnumdepth >\m@ne - \refstepcounter{part}% - \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}% - \else - \addcontentsline{toc}{part}{#1}% - \fi - {\parindent \z@ %\center - \interlinepenalty \@M - \normalfont - \ifnum \c@secnumdepth >\m@ne - \rm\Large \partname~\thepart - \par\nobreak - \fi - \MakeUppercase{\rm\Huge #2}% - \markboth{}{}\par}% - \nobreak - \vskip 8ex - \@afterheading} -\def\@spart#1{% - {\parindent \z@ %\center - \interlinepenalty \@M - \normalfont - \huge \bfseries #1\par}% - \nobreak - \vskip 3ex - \@afterheading} - -% use inconsolata font -\usepackage{inconsolata} - -% fix single quotes, for inconsolata. (does not work) -%%\usepackage{textcomp} -%%\begingroup -%% \catcode`'=\active -%% \g@addto@macro\@noligs{\let'\textsinglequote} -%% \endgroup -%%\endinput diff --git a/docs/latexindex.rst b/docs/latexindex.rst deleted file mode 100644 index 300e60d1..00000000 --- a/docs/latexindex.rst +++ /dev/null @@ -1,6 +0,0 @@ -:orphan: - -Jinja2 Documentation -==================== - -.. include:: contents.rst.inc diff --git a/docs/logo.pdf b/docs/logo.pdf deleted file mode 100644 index 3e8a9cf480ccbe4a30911bdb7d78c0b80e767c81..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 5677 zc-oa%c{r49)Q_?a*`n-*kh0B~8H_C1_kG{WV1@}ZjG1iNw?eYKYC>KlgzRLi>|;fP_5D@Eh z6`-I1l+s6HT=8x|=mBI300MzhnrII^5_j36@WJDd2v2}tMv!e! z$$SmV&0ol7pA#5Jcyh;S=8-6?0% z53o-Tq!4y%kyUxzaQjxc{l?O>I@zwrH{r|aStP~OkL3Kol-hj1q z0}XeA=ODofh@RR-`@p&w{Vqk)^#z0Vts6bg+kR6d#kLbnQB5sg@=U2gr)xXzUo99zQmDmxZZe$+^c!h220qr}nYUhRkAxyO#-;+p`3 zQLqQ>LyfP(wB{?_X|sqhe{wpFI7bvZoU|$IK_$jp@#K8%?WtGk(u$Zq3Z0>&Pmr^i=%)9+gDR7~x9 zomX+78=<6Vq2eI%l_KKvt;XxA-6h1h65Yk);;?Rua&2FtkU3l|==7koPLEA?;o$DI z-6b}AdM||%t_kNPii!8k@rr~x5lyxXo(I~U6VP~ZtvG>Uu1RQ&bDWY+a#s2s1izlw z3d`53lo~}%eWLVivS%{KK(PTIEBUk<&m~$h9T24RSO*WC-FuD|C7o}|3QF`I{_%EV zEmO&L!n96g?zab>7R?e6Z1_8DBs9@HK)x&@kL7qGqiF;VzUA}I#3+g5w#mxvy@d%ZnoIH@MaZyj>7x2YyG z6DV#lcSaA7c&|d~z6LD)z4Dg)Y&!Uu^3}N0J2S0KOxstoO#EE%Oj9b)<6Qcb+y1V9 zH!QVk=Rs$uBc~w>r!E(cK1Sv@HO&{K2#OFs6Xkzt!i%;-puqEz1f#oEaW)qxiBocx z3IT+Ff?uZmqS_VC>CM?##BhNhoUQjm|6yRp9MO$23LMh3S9D_5O(??xxobLLIN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ul9`7YDC3OV4;t*bLXlEZuEY9`(`5!gGVOF28JG(K9XR5VNfVY z_Wxp_gVOw=2a$vRfyqH-{=i^=+Jnl1{?LO-ga5DxJGdzSVt5<^?SaG{v0#P{Kpy6H obY-zvJP`iRJ3$A7!UE-fvEhS9;P6LWz#s>&Jz-%DBTc~n0QwZ5yZ`_I diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 00000000..7893348a --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% + +:end +popd diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000..cfe1fd75 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,4 @@ +Sphinx~=2.1.2 +Pallets-Sphinx-Themes~=1.2.0 +sphinxcontrib-log-cabinet~=1.0.1 +sphinx-issues~=1.2.0 diff --git a/docs/templates.rst b/docs/templates.rst index 236590f2..dd05add7 100644 --- a/docs/templates.rst +++ b/docs/templates.rst @@ -197,14 +197,14 @@ without the `trim_blocks` and `lstrip_blocks` options, this template:: gets rendered with blank lines inside the div::
- + yay - +
But with both `trim_blocks` and `lstrip_blocks` enabled, the template block lines are removed and other whitespace is preserved:: - +
yay
@@ -522,12 +522,12 @@ Working with Automatic Escaping ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When automatic escaping is enabled, everything is escaped by default except -for values explicitly marked as safe. Variables and expressions +for values explicitly marked as safe. Variables and expressions can be marked as safe either in: a. the context dictionary by the application with `MarkupSafe.Markup`, or b. the template, with the `|safe` filter - + The main problem with this approach is that Python itself doesn't have the concept of tainted values; so whether a value is safe or unsafe can get lost. @@ -1249,7 +1249,7 @@ something else>``. The `else` part is optional. If not provided, the else block implicitly evaluates into an undefined object:: - {{ '[%s]' % page.title if page.title }} + {{ "[{}]".format(page.title) if page.title }} .. _builtin-filters: @@ -1257,7 +1257,7 @@ evaluates into an undefined object:: List of Builtin Filters ----------------------- -.. jinjafilters:: +.. jinja:filters:: jinja2.defaults.DEFAULT_FILTERS .. _builtin-tests: @@ -1265,7 +1265,8 @@ List of Builtin Filters List of Builtin Tests --------------------- -.. jinjatests:: +.. jinja:tests:: jinja2.defaults.DEFAULT_TESTS + .. _builtin-globals: diff --git a/jinja2/lexer.py b/jinja2/lexer.py index 30e82fb0..c4817f47 100644 --- a/jinja2/lexer.py +++ b/jinja2/lexer.py @@ -352,7 +352,10 @@ class TokenStream(object): return self.next_if(expr) is not None def __next__(self): - """Go one token ahead and return the old one""" + """Go one token ahead and return the old one. + + Use Python's :func:`next` rather than calling this directly. + """ rv = self.current if self._pushed: self.current = self._pushed.popleft() diff --git a/scripts/make-release.py b/scripts/make-release.py index 6ea71629..f980be93 100644 --- a/scripts/make-release.py +++ b/scripts/make-release.py @@ -25,7 +25,7 @@ _date_strip_re = re.compile(r'(?<=\d)(st|nd|rd|th)') def parse_changelog(): - with open('CHANGES') as f: + with open('CHANGES.rst') as f: lineiter = iter(f) for line in lineiter: match = re.search('^Version\s+(.*)', line.strip()) -- 2.47.3