Skip to content

DOC: Only use ~ in class links to hide prefixes. #20402

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion doc/source/contributing_docstring.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,18 @@ backticks. It is considered inline code:
- The name of a parameter
- Python code, a module, function, built-in, type, literal... (e.g. ``os``,
``list``, ``numpy.abs``, ``datetime.date``, ``True``)
- A pandas class (in the form ``:class:`~pandas.Series```)
- A pandas class (in the form ``:class:`pandas.Series```)
- A pandas method (in the form ``:meth:`pandas.Series.sum```)
- A pandas function (in the form ``:func:`pandas.to_datetime```)

.. note::
To display only the last component of the linked class, method or
function, prefix it with ``~``. For example, ``:class:`~pandas.Series```
will link to ``pandas.Series`` but only display the last part, ``Series``
as the link text. See `Sphinx cross-referencing syntax
<http://www.sphinx-doc.org/en/stable/domains.html#cross-referencing-syntax>`_
for details.

**Good:**

.. code-block:: python
Expand Down