Skip to content

Commit 7986264

Browse files
committed
fixup! Hyphenate versioning admonitions
1 parent fa2b30f commit 7986264

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

sphinx/builders/changes.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,12 @@ def get_outdated_docs(self) -> str:
4444

4545
typemap = {
4646
'version-added': 'added',
47-
'version-changed': 'changed',
48-
'version-deprecated': 'deprecated',
49-
'version-removed': 'removed',
50-
# deprecated aliases
5147
'versionadded': 'added',
48+
'version-changed': 'changed',
5249
'versionchanged': 'changed',
50+
'version-deprecated': 'deprecated',
5351
'deprecated': 'deprecated',
52+
'version-removed': 'removed',
5453
'versionremoved': 'removed',
5554
}
5655

@@ -118,13 +117,12 @@ def write_documents(self, _docnames: Set[str]) -> None:
118117

119118
hltext = [
120119
f'.. version-added:: {version}',
121-
f'.. version-changed:: {version}',
122-
f'.. version-deprecated:: {version}',
123-
f'.. version-removed:: {version}',
124-
# deprecated alises
125120
f'.. versionadded:: {version}',
121+
f'.. version-changed:: {version}',
126122
f'.. versionchanged:: {version}',
123+
f'.. version-deprecated:: {version}',
127124
f'.. deprecated:: {version}',
125+
f'.. version-removed:: {version}',
128126
f'.. versionremoved:: {version}',
129127
]
130128

sphinx/domains/changeset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,13 @@ def get_changesets_for(self, version: str) -> list[ChangeSet]:
175175

176176
def setup(app: Sphinx) -> ExtensionMetadata:
177177
app.add_domain(ChangeSetDomain)
178-
app.add_directive('version-added', VersionChange)
179-
app.add_directive('version-changed', VersionChange)
180178
app.add_directive('version-deprecated', VersionChange)
181-
app.add_directive('version-removed', VersionChange)
182179
app.add_directive('deprecated', VersionChange)
180+
app.add_directive('version-added', VersionChange)
183181
app.add_directive('versionadded', VersionChange)
182+
app.add_directive('version-changed', VersionChange)
184183
app.add_directive('versionchanged', VersionChange)
184+
app.add_directive('version-removed', VersionChange)
185185
app.add_directive('versionremoved', VersionChange)
186186

187187
return {

0 commit comments

Comments
 (0)