Skip to content

Add versiondeprecated admonition #13714

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

stephenfin
Copy link
Contributor

Purpose

For consistency with other version* admonitions. While the deprecated admonition is marked as deprecated itself in the docs, we do not do anything at runtime since there is almost zero cost to keeping this relative to the work needed for millions of documents to be updated.

All our own uses of this admonition are switched, with some changed to versionchanged where that makes more sense (typically because an attribute or aspect of a feature was deprecated but not the whole feature itself).

References

  • <...>
  • <...>
  • <...>

@timhoffm
Copy link
Contributor

timhoffm commented Jul 2, 2025

Is this really worth it? Yes, consistency is nice, but I’ve used all these directives and I’ve never stumbled on the naming; .. deprecated:: felt quite natural to me. I actually find .. versiondeprecated:: harder to read and type.

If this is added, I’d at least not deprecate deprecated. Instead, keep both, either as equivalent, or with a recommendation for one. Announcing that deprecated is deprecated will push users into updating because it implies that it will be removed in the future, and I think we should not burden users with this. If you instead state a preference only, new code will use it. Since deprecated statements will by-design be removed after some time, code bases will evolve naturally into the new state, and then deprecating deprecated at some point in the future has much smaller effect.

@stephenfin
Copy link
Contributor Author

stephenfin commented Jul 2, 2025

Is this really worth it? Yes, consistency is nice, but I’ve used all these directives and I’ve never stumbled on the naming; .. deprecated:: felt quite natural to me. I actually find .. versiondeprecated:: harder to read and type.

Is it needed? No. But it's helpful to have the set of versionadded, versionchanged, and versionremoved. An alternative would be to provide added, changed, and removed aliases (or introduce hyphens to all).

If this is added, I’d at least not deprecate deprecated. Instead, keep both, either as equivalent, or with a recommendation for one. Announcing that deprecated is deprecated will push users into updating because it implies that it will be removed in the future, and I think we should not burden users with this. If you instead state a preference only, new code will use it. Since deprecated statements will by-design be removed after some time, code bases will evolve naturally into the new state, and then deprecating deprecated at some point in the future has much smaller effect.

I agree. That's my intention in only noting it in the docs: I specifically did not want to create busy work for people.

@AA-Turner
Copy link
Member

I'd be happy to add alternative forms with a hyphen, we've done this already for various directive options (no-index, etc). Otherwise I'm ambivalent -- the shorter forms (.. addded::) seem cleaner, but the existing ones are clearer about what they describe.

A

Use e.g. 'version-changed' over 'versionchanged'. While the deprecated
admonition is marked as deprecated itself in the docs, we do not do
anything at runtime since there is almost zero cost to keeping this
relative to the work needed for millions of documents to be updated.

All our own uses of the 'deprecated' admonition are switched, with some
changed to versionchanged where that makes more sense (typically because
an attribute or aspect of a feature was deprecated but not the whole
feature itself). Changes to the other admonitions will be kept to a
separate commit to keep this one reviewable.

Signed-off-by: Stephen Finucane <[email protected]>
@stephenfin stephenfin force-pushed the versiondeprecated-admonition branch from ff4146d to 6e01dbf Compare July 3, 2025 16:35
@stephenfin
Copy link
Contributor Author

I'd be happy to add alternative forms with a hyphen, we've done this already for various directive options (no-index, etc). Otherwise I'm ambivalent -- the shorter forms (.. addded::) seem cleaner, but the existing ones are clearer about what they describe.

Sure. Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants