Skip to content

Commit d784393

Browse files
committed
Update release notes.
Add an extension to link to GitHub user profiles directly from the documentation.
1 parent 7170f87 commit d784393

3 files changed

Lines changed: 26 additions & 1 deletion

File tree

doc/_extensions/github_user.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from docutils import nodes
2+
from sphinx.util.docutils import SphinxRole
3+
4+
class GitHubUserRole(SphinxRole):
5+
def run(self):
6+
username = self.text.strip()
7+
url = f"https://github.com/{username}"
8+
node = nodes.reference(rawtext=self.rawtext, text=f"@{username}", refuri=url, **self.options)
9+
return [node], []
10+
11+
def setup(app):
12+
"""Register extension with Sphinx."""
13+
app.add_role('github_user', GitHubUserRole())
14+
return {
15+
'version': '1.0',
16+
'parallel_read_safe': True,
17+
'parallel_write_safe': True,
18+
}

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# -- General ------------------------------------------------------------------
1313

1414
# Extensions.
15-
extensions = ["changelog", "sphinx.ext.intersphinx"]
15+
extensions = ["changelog", "github_user", "sphinx.ext.intersphinx"]
1616

1717
# The suffix of source filenames.
1818
source_suffix = ".rst"

doc/release/release_notes.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
Release Notes
55
*************
66

7+
.. release:: Upcoming
8+
9+
.. change:: changed
10+
11+
Updated the :func:`pytest_discover_tests` function to avoid rediscovering tests with
12+
every build. Thanks :github_user:`mhx`!
13+
714
.. release:: 0.11.0
815
:date: 2024-10-15
916

0 commit comments

Comments
 (0)