Skip to content

Commit

Permalink
Add sphinx towncrier extension and link changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsDrike committed Feb 7, 2023
1 parent 7f9cebd commit fac659a
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 1 deletion.
8 changes: 8 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import sys
from datetime import date
from pathlib import Path

from packaging.version import parse as parse_version

Expand Down Expand Up @@ -46,6 +47,8 @@
"m2r2",
# Copyable codeblocks
"sphinx_copybutton",
# Towncrier changelog
"sphinxcontrib.towncrier.ext",
]

autoclass_content = "both"
Expand Down Expand Up @@ -104,6 +107,11 @@
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True

# Towncrier
towncrier_draft_autoversion_mode = "draft"
towncrier_draft_include_empty = True
towncrier_draft_working_directory = Path(__file__).parents[1].resolve()


# -- Other options -----------------------------------------------------------

Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Content
pages/installation.rst
examples/index.rst
pages/faq.rst
pages/changelog.rst
pages/contributing.rst
pages/code-of-conduct.rst

Expand Down
9 changes: 9 additions & 0 deletions docs/pages/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Changelog
=========

.. attention::
Major and minor releases also include the changes specified in prior development releases.

.. towncrier-draft-entries:: Unreleased changes

.. mdinclude:: ../../CHANGELOG.md
18 changes: 17 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ m2r2 = "^0.3.3.post2"
packaging = "^23.0"
sphinx-autodoc-typehints = "^1.22"
sphinx-copybutton = "^0.5.1"
sphinxcontrib-towncrier = "^0.3.2a0"

[tool.poetry.group.docs-ci]
optional = true
Expand Down

0 comments on commit fac659a

Please sign in to comment.