Documentation query

How do we add cross links in the docs?
In my case:

    def to_data_frame(
        self,
        picks=None,
        index=None,
        scalings=None,
        copy=True,
        start=None,
        stop=None,
        long_format=False,
        time_format=None,
        *,
        verbose=None,
    ):
        """Export data in tabular structure as a pandas DataFrame.

        Channels are converted to columns in the DataFrame. By default, an
        additional column "time" is added, unless ``index`` is not ``None``
        (in which case time values form the DataFrame's index).

        Parameters
        ----------
        %(picks_all)s
        %(index_df_raw)s
            Defaults to ``None``.
        %(scalings_df)s
        %(copy_df)s
        start : int | None
            Starting sample index for creating the DataFrame from a temporal
            span of the Raw object. ``None`` (the default) uses the first
            sample.
        stop : int | None
            Ending sample index for creating the DataFrame from a temporal span
            of the Raw object. ``None`` (the default) uses the last sample.
        %(long_format_df_raw)s
        %(time_format_df_raw)s

            .. versionadded:: 0.20
        %(verbose)s

        Returns
        -------
        %(df_return)s

        Notes
        -----
        This method by default converts the data(``pandas.DataFrame``) to its
        standard unit and then returns it.
        """

The notes section is the new addition, fixin the issue #12701.
But I want the fully rendered notes section to looks something like this:

This method by default converts the data(pandas.DataFrame) to its
standard unit and then returns it. See Internal Representations and data channels..

How can we do that?

You can use the Sphinx roles ref and term.

Like the docs say, term is used to link to items in a glossary (the data channels entry in the glossary is here).
So you would use :term:`data channels` (example).

ref is a more general link for labels that can go anywhere in the docs. E.g., for a link to the units section, you want :ref:`units` which you find here (example).

1 Like

you’re the best

1 Like