Skip to content

Commit 3329a7e

Browse files
committed
Display changelog for unreleased version in docs
1 parent dc026b9 commit 3329a7e

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

docs/conf.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
from pathlib import Path
2+
3+
14
extensions = ['sphinx.ext.autodoc', 'jaraco.packaging.sphinx', 'rst.linker']
25

36
master_doc = "index"
@@ -143,3 +146,16 @@
143146
'python': ('https://docs.python.org/3', None),
144147
'python2': ('https://docs.python.org/2', None),
145148
}
149+
150+
# Add support for the unreleased "next-version" change notes
151+
extensions += ['sphinxcontrib.towncrier']
152+
153+
154+
# -- Options for towncrier_draft extension --------------------------------------------
155+
156+
PROJECT_ROOT_DIR = Path(__file__).parents[1].resolve()
157+
158+
towncrier_draft_autoversion_mode = "draft" # or: 'sphinx-release', 'sphinx-version'
159+
towncrier_draft_include_empty = True
160+
towncrier_draft_working_directory = PROJECT_ROOT_DIR
161+
# Not yet supported: towncrier_draft_config_path = 'pyproject.toml' # relative to cwd

docs/history.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
History
66
*******
77

8+
.. towncrier-draft-entries:: DRAFT, unreleased as on |today|
9+
810
.. include:: ../CHANGES (links).rst
911

1012
Credits

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ docs =
7575
# local
7676
pygments-github-lexers==0.0.5
7777
sphinx-inline-tabs
78+
sphinxcontrib-towncrier
7879

7980
ssl =
8081
wincertstore==0.2; sys_platform=='win32'

0 commit comments

Comments
 (0)