From 7536262a2f91d3b219a12b172bc18338300f6047 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 1 Mar 2021 18:26:21 +0000 Subject: [PATCH] Add configuration for sphinx rendering of the changelog [ci skip] --- docs/changelog.rst | 4 +++- docs/changes/template.rst | 8 -------- docs/conf.py | 4 ++++ setup.cfg | 1 + 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index f34a16c866ea..9a465b496edc 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -4,4 +4,6 @@ Full Changelog ************** -.. include:: ../CHANGES.rst +.. changelog:: + :towncrier: ../ + :changelog_file: ../CHANGES.rst diff --git a/docs/changes/template.rst b/docs/changes/template.rst index b3afc6f63e86..721ddf2fd7d4 100644 --- a/docs/changes/template.rst +++ b/docs/changes/template.rst @@ -1,11 +1,3 @@ -{% if versiondata.name %} -{{ versiondata.name }} {{ versiondata.version }} ({{ versiondata.date }}) -{{ top_underline * ((versiondata.name + versiondata.version + versiondata.date)|length + 4)}} -{% else %} -{{ versiondata.version }} ({{ versiondata.date }}) -{{ top_underline * ((versiondata.version + versiondata.date)|length + 3)}} -{% endif %} - {% for category, val in definitions.items() %} {% set underline = underlines[0] %} {{ definitions[category]['name'] }} diff --git a/docs/conf.py b/docs/conf.py index aa56f426fc4a..a686a45fa152 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -78,6 +78,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns.append('_templates') # noqa: F405 +exclude_patterns.append('changes') # noqa: F405 exclude_patterns.append('_pkgtemplate.rst') # noqa: F405 exclude_patterns.append('**/*.inc.rst') # .inc.rst mean *include* files, don't have sphinx process them # noqa: F405, E501 @@ -86,6 +87,9 @@ templates_path = [] templates_path.append('_templates') + +extensions += ["sphinx_changelog"] # noqa: F405 + # Grab minversion from setup.cfg setup_cfg = configparser.ConfigParser() setup_cfg.read(os.path.join(os.path.pardir, 'setup.cfg')) diff --git a/setup.cfg b/setup.cfg index 40b2d4a41ea1..563e4d437ca7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -85,6 +85,7 @@ docs = PyYAML>=3.13 scipy>=1.1 matplotlib>=3.1,!=3.4.0 + sphinx-changelog [options.package_data] * = data/*, data/*/*, data/*/*/*, data/*/*/*/*, data/*/*/*/*/*, data/*/*/*/*/*/*