diff --git a/CHANGES b/CHANGES index 1d95a888e4b..16920e78a61 100644 --- a/CHANGES +++ b/CHANGES @@ -81,6 +81,12 @@ Features added * #8619: html: kbd role generates customizable HTML tags for compound keys * #8634: html: Allow to change the order of JS/CSS via ``priority`` parameter for :meth:`Sphinx.add_js_file()` and :meth:`Sphinx.add_css_file()` +* #6241: html: Allow to add JS/CSS files to the specific page when an extension + calls ``app.add_js_file()`` or ``app.add_css_file()`` on + :event:`html-page-context` event +* #8649: imgconverter: Skip availability check if builder supports the image + type +* #6241: mathjax: Include mathjax.js only on the document using equations * #8132: Add :confval:`project_copyright` as an alias of :confval:`copyright` Bugs fixed @@ -102,7 +108,7 @@ Bugs fixed Testing -------- -Release 3.4.2 (in development) +Release 3.4.4 (in development) ============================== Dependencies @@ -120,15 +126,30 @@ Features added Bugs fixed ---------- +Testing +-------- + +Release 3.4.3 (released Jan 08, 2021) +===================================== + +Bugs fixed +---------- + +* #8655: autodoc: Failed to generate document if target module contains an + object that raises an exception on ``hasattr()`` + +Release 3.4.2 (released Jan 04, 2021) +===================================== + +Bugs fixed +---------- + * #8164: autodoc: Classes that inherit mocked class are not documented * #8602: autodoc: The ``autodoc-process-docstring`` event is emitted to the non-datadescriptors unexpectedly * #8616: autodoc: AttributeError is raised on non-class object is passed to autoclass directive -Testing --------- - Release 3.4.1 (released Dec 25, 2020) ===================================== diff --git a/doc/extdev/appapi.rst b/doc/extdev/appapi.rst index 5c9106bbdf2..1a4c30d6d64 100644 --- a/doc/extdev/appapi.rst +++ b/doc/extdev/appapi.rst @@ -376,6 +376,9 @@ Here is a more detailed list of these events. You can return a string from the handler, it will then replace ``'page.html'`` as the HTML template for this page. + .. note:: You can install JS/CSS files for the specific page via + :meth:`Sphinx.add_js_file` and :meth:`Sphinx.add_css_file` since v3.5.0. + .. versionadded:: 0.4 .. versionchanged:: 1.3 diff --git a/doc/usage/configuration.rst b/doc/usage/configuration.rst index 2cfc7d9ff33..7a92cc12a04 100644 --- a/doc/usage/configuration.rst +++ b/doc/usage/configuration.rst @@ -1003,7 +1003,14 @@ that use Sphinx's HTMLWriter class. 'https://example.com/css/custom.css', ('print.css', {'media': 'print'})] + As a special attribute, *priority* can be set as an integer to load the CSS + file earlier or lazier step. For more information, refer + :meth:`Sphinx.add_css_files()`. + .. versionadded:: 1.8 + .. versionchanged:: 3.5 + + Support priority attribute .. confval:: html_js_files @@ -1019,7 +1026,14 @@ that use Sphinx's HTMLWriter class. 'https://example.com/scripts/custom.js', ('custom.js', {'async': 'async'})] + As a special attribute, *priority* can be set as an integer to load the CSS + file earlier or lazier step. For more information, refer + :meth:`Sphinx.add_css_files()`. + .. versionadded:: 1.8 + .. versionchanged:: 3.5 + + Support priority attribute .. confval:: html_static_path diff --git a/sphinx/application.py b/sphinx/application.py index 40098e92d9d..710d7701a5c 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -917,9 +917,11 @@ def add_js_file(self, filename: str, priority: int = 500, **kwargs: Any) -> None Add *filename* to the list of JavaScript files that the default HTML template will include in order of *priority* (ascending). The filename must be relative to the HTML static path , or a full URI with scheme. - If the keyword argument ``body`` is given, its value will be added - between the ``' in content) +@pytest.mark.sphinx('html', testroot='ext-math', + confoverrides={'extensions': ['sphinx.ext.mathjax']}) +def test_mathjax_is_installed_only_if_document_having_math(app, status, warning): + app.builder.build_all() + + content = (app.outdir / 'index.html').read_text() + assert MATHJAX_URL in content + + content = (app.outdir / 'nomath.html').read_text() + assert MATHJAX_URL not in content + + @pytest.mark.sphinx('html', testroot='basic', confoverrides={'extensions': ['sphinx.ext.mathjax']}) def test_mathjax_is_not_installed_if_no_equations(app, status, warning): diff --git a/utils/release-checklist b/utils/release-checklist index dad83c850e9..671f932d816 100644 --- a/utils/release-checklist +++ b/utils/release-checklist @@ -4,7 +4,7 @@ Release checklist for stable releases ------------------- -* open https://github.com/sphinx-doc/sphinx/actions?query=branch:X.Y.x and all tests has passed +* open "https://github.com/sphinx-doc/sphinx/actions?query=branch:X.Y.x" and all tests has passed * Run ``git fetch; git status`` and check nothing changed * ``python utils/bump_version.py X.Y.Z`` * Check diff by ``git diff`` @@ -28,7 +28,7 @@ for stable releases for first beta releases ----------------------- -* open https://github.com/sphinx-doc/sphinx/actions?query=branch:master and all tests has passed +* open "https://github.com/sphinx-doc/sphinx/actions?query=branch:master" and all tests has passed * Run ``git fetch; git status`` and check nothing changed * Run ``python setup.py extract_messages`` * Run ``(cd sphinx/locale; tx push -s)`` @@ -58,7 +58,7 @@ for first beta releases for other beta releases ----------------------- -* open https://github.com/sphinx-doc/sphinx/actions?query=branch:X.x and all tests has passed +* open "https://github.com/sphinx-doc/sphinx/actions?query=branch:X.x" and all tests has passed * Run ``git fetch; git status`` and check nothing changed * ``python utils/bump_version.py X.Y.0bN`` * Check diff by ``git diff`` @@ -81,7 +81,7 @@ for other beta releases for major releases ------------------ -* open https://github.com/sphinx-doc/sphinx/actions?query=branch:X.x and all tests has passed +* open "https://github.com/sphinx-doc/sphinx/actions?query=branch:X.x" and all tests has passed * Run ``git fetch; git status`` and check nothing changed * Run ``(cd sphinx/locale; tx pull -a -f)`` * Run ``python setup.py compile_catalog``