diff --git a/doc/api/api_changes.rst b/doc/api/api_changes.rst index 730906262c23..495aa05f4e5a 100644 --- a/doc/api/api_changes.rst +++ b/doc/api/api_changes.rst @@ -10,14 +10,13 @@ out what caused the breakage and how to fix it by updating your code. For new features that were added to Matplotlib, please see :ref:`whats-new`. -.. for a release comment out the toctree below +.. ifconfig:: __import__('pkg_resources').parse_version(version).local + .. toctree:: + :glob: + :maxdepth: 1 -.. toctree:: - :glob: - :maxdepth: 1 - - next_api_changes/* + next_api_changes/* API Changes in 2.2.0 diff --git a/doc/conf.py b/doc/conf.py index d011a25fc6ea..c4a0e138df98 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -31,6 +31,7 @@ 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.doctest', + 'sphinx.ext.ifconfig', 'sphinx.ext.inheritance_diagram', 'sphinx.ext.intersphinx', 'IPython.sphinxext.ipython_console_highlighting', diff --git a/doc/devel/release_guide.rst b/doc/devel/release_guide.rst index 73d7eb8bea39..d0db699e5d51 100644 --- a/doc/devel/release_guide.rst +++ b/doc/devel/release_guide.rst @@ -48,10 +48,10 @@ Review and commit changes. Some issue/PR titles may not be valid rst (the most Check Docs ---------- -Before tagging, update the what's new listing in :file:`doc/users/whats_new.rst` -by merging all files in :file:`doc/users/next_whats_new/` coherently. Also, -temporarily comment out the include and toctree glob; re-instate these after a -release. Finally, make sure that the docs build cleanly :: +Before tagging, update the what's new listing in +:file:`doc/users/whats_new.rst` by merging all files in +:file:`doc/users/next_whats_new/` coherently. Then, make sure that the docs +build cleanly:: make -Cdoc O=-n$(nproc) html latexpdf diff --git a/doc/users/next_whats_new/README.rst b/doc/users/next_whats_new/README.rst index e29acc0f00a9..7444fe8b6632 100644 --- a/doc/users/next_whats_new/README.rst +++ b/doc/users/next_whats_new/README.rst @@ -9,7 +9,9 @@ When adding an entry please look at the currently existing files to see if you can extend any of them. If you create a file, name it something like :file:`cool_new_feature.rst` if you have added a brand new feature or something like :file:`updated_feature.rst` for extensions of -existing features. Include contents of the form: :: +existing features. Include contents of the form: + +.. code-block:: rst Section Title for Feature ------------------------- diff --git a/doc/users/whats_new.rst b/doc/users/whats_new.rst index df0aa9375632..2ac5da03cf6b 100644 --- a/doc/users/whats_new.rst +++ b/doc/users/whats_new.rst @@ -10,16 +10,14 @@ revision, see the :ref:`github-stats`. .. contents:: Table of Contents :depth: 4 +.. ifconfig:: __import__('pkg_resources').parse_version(version).local -.. - For a release, add a new section after this, then comment out the include - and toctree below by indenting them. Uncomment them after the release. -.. include:: next_whats_new/README.rst -.. toctree:: - :glob: - :maxdepth: 1 + .. include:: next_whats_new/README.rst + .. toctree:: + :glob: + :maxdepth: 1 - next_whats_new/* + next_whats_new/* New in Matplotlib 2.2