Skip to content

Commit

Permalink
DOC: Only use ~ in class links to hide prefixes. (#20402)
Browse files Browse the repository at this point in the history
  • Loading branch information
dukebody authored and jorisvandenbossche committed Mar 19, 2018
1 parent f4343b3 commit 7273ea0
Showing 1 changed file with 9 additions and 1 deletion.
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

0 comments on commit 7273ea0

Please sign in to comment.