Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add versionremoved directive to complement versionadded and deprecated #11480

Closed
4 tasks
consideRatio opened this issue Jul 3, 2023 · 3 comments · Fixed by #11905
Closed
4 tasks

Add versionremoved directive to complement versionadded and deprecated #11480

consideRatio opened this issue Jul 3, 2023 · 3 comments · Fixed by #11905
Labels
type:enhancement enhance or introduce a new feature

Comments

@consideRatio
Copy link

consideRatio commented Jul 3, 2023

Background

In PEP4, deprecated is a word used to indicate something may be removed in the future.

Usage of a module may be ‘deprecated’, which means that it may be removed from a future Python release.

The existing sphinx directives versionadded, versionchanged, and deprecated are excellent in reference documentation, but when something deprecated is removed, its not clear what to do without a versionremoved directive. Authoring reference documentation, I'd like to document that something has been around even after it is removed and can't be used any more.

Proposal

I suggest a versionremoved directive is added alongside the other related directives below, together with new documentation alongside versionadded as seen here.

versionlabels = {
'versionadded': _('New in version %s'),
'versionchanged': _('Changed in version %s'),
'deprecated': _('Deprecated since version %s'),
}
versionlabel_classes = {
'versionadded': 'added',
'versionchanged': 'changed',
'deprecated': 'deprecated',
}

Looking into the details, it seems like this is relevant to update:

Options

Sphinx users can patch sphinx via the sphinx extension sphinx-removed-in does, from where the proposal stems from - thank you @atodorov, @hroncok, @nicoddemus who have made commits to that project.

For sphinx>=2, this extension is like adding this to a conf.py file:

# -- Add versionremoved directive ---------------------------------------------------
# ref: https://github.com/sphinx-doc/sphinx/issues/11480
#
from sphinx.domains.changeset import VersionChange, versionlabel_classes, versionlabels


def setup(app):
    if "versionremoved" not in versionlabels:
        versionlabels["versionremoved"] = "Removed in version %s"
        versionlabel_classes["versionremoved"] = "removed"
        app.add_directive("versionremoved", VersionChange)
@picnixz
Copy link
Member

picnixz commented Aug 31, 2023

PR is welcomed!

@picnixz picnixz added the type:enhancement enhance or introduce a new feature label Aug 31, 2023
@hugovk
Copy link
Contributor

hugovk commented Jan 21, 2024

Please see PR #11905.

@consideRatio
Copy link
Author

Thank you @hugovk and everyone involved!! 🎉 ❤️

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type:enhancement enhance or introduce a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants