Skip to content
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

Add note about docstrings for aliases #18157

Merged
merged 1 commit into from
Aug 21, 2016
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
26 changes: 26 additions & 0 deletions doc/manual/documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,32 @@ Global Variables

Adds docstring ``"..."`` to the ``Binding``\ s ``a``, ``b``, and ``c``.

.. note::

When a ``const`` definition is only used to define an alias of another definition, such
as is the case with the function ``div`` and its alias ``÷`` in ``Base``, do not
document the alias and instead document the actual function.

If the alias is documented and not the real definition then the docsystem (``?`` mode)
will not return the docstring attached to the alias when the real definition is
searched for.

For example you should write

.. code-block:: julia

"..."
f(x) = x + 1
const alias = f

rather than

.. code-block:: julia

f(x) = x + 1
"..."
const alias = f

.. code-block:: julia

"..."
Expand Down