-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix heading anchors in relnotes (#1605)
- Loading branch information
1 parent
0c459a0
commit 07ca87c
Showing
7 changed files
with
44 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"""Override MyST’s cite role with one that works.""" | ||
|
||
from __future__ import annotations | ||
|
||
from types import MappingProxyType | ||
from typing import TYPE_CHECKING | ||
|
||
from docutils import nodes, utils | ||
|
||
if TYPE_CHECKING: | ||
from collections.abc import Mapping, Sequence | ||
from typing import Any | ||
|
||
from docutils.parsers.rst.states import Inliner | ||
from sphinx.application import Sphinx | ||
|
||
|
||
def cite_role( # noqa: PLR0917 | ||
name: str, | ||
rawsource: str, | ||
text: str, | ||
lineno: int, | ||
inliner: Inliner, | ||
options: Mapping[str, Any] = MappingProxyType({}), | ||
content: Sequence[str] = (), | ||
) -> tuple[list[nodes.Node], list[nodes.system_message]]: | ||
key = utils.unescape(text) | ||
node = nodes.citation_reference(f"[{key}]_", key) | ||
return [node], [] | ||
|
||
|
||
def setup(app: Sphinx): | ||
app.add_role("cite", cite_role, override=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
(0.10.8)= | ||
(v0.10.8)= | ||
### 0.10.8 {small}`2024-06-20` | ||
|
||
#### Bugfix | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
(0.10.9)= | ||
(v0.10.9)= | ||
### 0.10.9 {small}`the future` | ||
|
||
#### Bugfix | ||
|