diff options
author | James Addison <55152140+jayaddison@users.noreply.github.com> | 2023-04-23 19:06:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-23 19:06:44 +0100 |
commit | 59de8d52029deca803d38b5d084a3a32c7b7f994 (patch) | |
tree | afd2646cf550155a10a8a9444697ad892f009e90 /doc | |
parent | aee3c0ab75974790adf359a9c5089d1d781a6b21 (diff) | |
download | sphinx-git-59de8d52029deca803d38b5d084a3a32c7b7f994.tar.gz |
Revert "Support and prefer ``.jinja`` to ``_t`` for static templates (#11165)" (#11329)
This reverts commit 5d13215b58f93c6be8255ef2e3e20836508c7d47.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/development/theming.rst | 46 | ||||
-rw-r--r-- | doc/latex.rst | 8 |
2 files changed, 8 insertions, 46 deletions
diff --git a/doc/development/theming.rst b/doc/development/theming.rst index 5a066082e..538dcafa6 100644 --- a/doc/development/theming.rst +++ b/doc/development/theming.rst @@ -156,51 +156,13 @@ template static files as well as HTML files. Therefore, Sphinx supports so-called "static templates", like this: If the name of a file in the ``static/`` directory of a theme (or in the user's -static path, for that matter) ends with ``.jinja``, it will be processed by the -template engine. The ``.jinja`` will be removed from the final file name. For -example, the *classic* theme has a file ``static/classic.css.jinja`` which uses -templating to put the colour options into the stylesheet. When a documentation +static path, for that matter) ends with ``_t``, it will be processed by the +template engine. The ``_t`` will be left from the final file name. For +example, the *classic* theme has a file ``static/classic.css_t`` which uses +templating to put the color options into the stylesheet. When a documentation project is built with the classic theme, the output directory will contain a ``_static/classic.css`` file where all template tags have been processed. -.. versionchanged:: 6.2 - - The preferred suffix for static templates is now ``.jinja``, in line with - the Jinja project's `recommended file extension`_. - - The ``_t`` file suffix for static templates is now considered 'legacy', and - support will eventually be removed. The standard deprecation process will - begin no earlier than 31 December 2024, at which point using ``_t`` suffixes - will emit ``RemovedInSphinx__Warning`` warnings. - - If a static template with a ``_t`` suffix is detected, it will be processed - by the template engine, with the ``_t`` suffix removed from the final file - name. - - To silence the warning for ``_t`` suffixes, the new - ``sphinx.deprecation.OldJinjaSuffixWarning`` class has been added for use - with Python's standard `warning control`_ mechanisms. This class will be - removed no earlier than 31 December 2024, so guard any imports with a - try/except block. - For example, in a ``setup()`` function: - - .. code:: python - - import warnings - - def setup(app): - try: - from sphinx.deprecation import OldJinjaSuffixWarning - except ImportError: - pass # Only silence the warning if it exists! - else: - warnings.filterwarnings('ignore', category=OldJinjaSuffixWarning) - - ... - - .. _recommended file extension: https://jinja.palletsprojects.com/en/latest/templates/#template-file-extension - .. _warning control: https://docs.python.org/3/library/warnings.html#the-warnings-filter - Use custom page metadata in HTML templates ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/latex.rst b/doc/latex.rst index 596e7a18c..504403427 100644 --- a/doc/latex.rst +++ b/doc/latex.rst @@ -1813,12 +1813,12 @@ Miscellany .. hint:: As an experimental feature, Sphinx can use user-defined template file for - LaTeX source if you have a file named ``_templates/latex.tex.jinja`` in your + LaTeX source if you have a file named ``_templates/latex.tex_t`` in your project. - Additional files ``longtable.tex.jinja``, ``tabulary.tex.jinja`` and - ``tabular.tex.jinja`` can be added to ``_templates/`` to configure some - aspects of table rendering (such as the caption position). + Additional files ``longtable.tex_t``, ``tabulary.tex_t`` and + ``tabular.tex_t`` can be added to ``_templates/`` to configure some aspects + of table rendering (such as the caption position). .. versionadded:: 1.6 currently all template variables are unstable and undocumented. |