From 99624f12d9b51125e5890dd0eed26d665e78b75b Mon Sep 17 00:00:00 2001 From: "Philipp A." Date: Fri, 13 Sep 2024 15:42:44 +0200 Subject: [PATCH] Add relnotes directive to docs (#172) --- docs/index.rst | 1 + pyproject.toml | 3 ++- src/scanpydoc/release_notes.py | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index c3936f9..e835a44 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -13,6 +13,7 @@ Included extensions definition_list_typed_field elegant_typehints rtd_github_links + release_notes theme .. hidden deprecated extension(s): diff --git a/pyproject.toml b/pyproject.toml index de33ac2..5b70150 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ test = [ 'defusedxml', # sphinx[test] would also pull in cython ] doc = [ - 'scanpydoc[typehints,theme]', + 'scanpydoc[typehints,myst,theme]', 'sphinx', 'readthedocs-sphinx-search', ] @@ -100,6 +100,7 @@ python = '3.11' features = ['doc'] [tool.hatch.envs.docs.scripts] build = 'sphinx-build -M html docs docs/_build' +clean = 'git clean -fdX docs' [tool.hatch.envs.hatch-test] features = ['test', 'typehints', 'myst'] diff --git a/src/scanpydoc/release_notes.py b/src/scanpydoc/release_notes.py index 74672bb..7bf21ad 100644 --- a/src/scanpydoc/release_notes.py +++ b/src/scanpydoc/release_notes.py @@ -7,7 +7,7 @@ .. release-notes:: . -With e.g. the files `1.2.0.md`, `1.2.1.md`, `1.3.0.rst`, and `1.3.2.rst`, +With e.g. the files :file:`1.2.0.md`, :file:`1.2.1.md`, and :file:`1.3.0.rst`, this will render like the following: .. code:: restructuredtext @@ -17,9 +17,9 @@ Version 1.3 =========== - .. include:: 1.3.2.rst .. include:: 1.3.0.rst + _v1.2: Version 1.2 @@ -182,6 +182,6 @@ def run(self) -> Sequence[nodes.Node]: @_setup_sig def setup(app: Sphinx) -> dict[str, Any]: - """Add the `release-notes` directive.""" + """Add the ``release-notes`` directive.""" app.add_directive("release-notes", ReleaseNotes) return metadata