Skip to content

Commit

Permalink
[misc] update wording of versionadded to Added in [...] (#12184)
Browse files Browse the repository at this point in the history
Motivated by the community feedback, the wording of ``versionadded`` is changed 
from ``New in [...]`` to ``Added in [...]``.
  • Loading branch information
picnixz committed Apr 5, 2024
1 parent 17a84a6 commit db4939f
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ Features added
.. _OSC 8: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
.. _groff: https://lists.gnu.org/archive/html/groff/2021-10/msg00000.html

* #11015: :rst:dir:`versionadded` wording changes from ``New in [...]``
to ``Added in [...]``.
Patch by Bénédikt Tran.


Bugs fixed
----------

Expand Down
2 changes: 1 addition & 1 deletion sphinx/domains/changeset.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


versionlabels = {
'versionadded': _('New in version %s'),
'versionadded': _('Added in version %s'),
'versionchanged': _('Changed in version %s'),
'deprecated': _('Deprecated since version %s'),
'versionremoved': _('Removed in version %s'),
Expand Down
2 changes: 1 addition & 1 deletion sphinx/util/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def get_full_module_name(node: Node) -> str:
def repr_domxml(node: Node, length: int = 80) -> str:
"""
return DOM XML representation of the specified node like:
'<paragraph translatable="False"><inline classes="versionmodified">New in version...'
'<paragraph translatable="False"><inline classes="versionadded">Added in version...'
:param nodes.Node node: target node
:param int length:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_builders/test_build_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def test_build(app):

# TODO: Use better checking of html content
htmltext = (app.outdir / 'changes.html').read_text(encoding='utf8')
assert 'New in version 0.6: Some funny stuff.' in htmltext
assert 'Added in version 0.6: Some funny stuff.' in htmltext
assert 'Changed in version 0.6: Even more funny stuff.' in htmltext
assert 'Deprecated since version 0.6: Boring stuff.' in htmltext

Expand Down
2 changes: 1 addition & 1 deletion tests/test_builders/test_build_html_5_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def checker(nodes):
# abbreviations
('markup.html', ".//abbr[@title='abbreviation']", '^abbr$'),
# version stuff
('markup.html', ".//div[@class='versionadded']/p/span", 'New in version 0.6: '),
('markup.html', ".//div[@class='versionadded']/p/span", 'Added in version 0.6: '),
('markup.html', ".//div[@class='versionadded']/p/span",
tail_check('First paragraph of versionadded')),
('markup.html', ".//div[@class='versionchanged']/p/span",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_intl/test_intl.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ def get_content(result, name):
assert expect1 == matched_content

expect2 = (
"""<p><span class="versionmodified added">New in version 1.0: </span>"""
"""<p><span class="versionmodified added">Added in version 1.0: </span>"""
"""THIS IS THE <em>FIRST</em> PARAGRAPH OF VERSIONADDED.</p>\n""")
matched_content = get_content(result, "versionadded")
assert expect2 == matched_content
Expand Down

0 comments on commit db4939f

Please sign in to comment.