sphinx icon indicating copy to clipboard operation
sphinx copied to clipboard

[docs] clarify the usage of `versionadded` & co

Open picnixz opened this issue 8 months ago • 9 comments

Describe the bug

It's interesting to see that the :: construction fails when inside the versionadded/versionchanged directive. It might actually be an issue in Sphinx (because otherwise, the :: should be smart).

Originally posted in https://github.com/python/cpython/issues/120091#issuecomment-2150319649

I'm not really sure how to make it work but if it's too much work, let's just indicate the behaviour in the documentation of .. versionadded & co directives.

How to Reproduce

Welcome to documentation!
=========================


It is now::

>>> ok

It is now2::

   >>> ok

.. versionadded:: 3.14 It is
   now3::

   >>> ok

.. versionadded:: 3.14 It is
   now4::

      >>> ok


.. versionadded:: 3.14
   It is now5::

   >>> ok


.. versionadded:: 3.14
   It is now6::

      >>> ok

produces

image

picnixz avatar Jun 05 '24 15:06 picnixz