lantunes / cellpylib

A library for working with Cellular Automata, for Python.
https://cellpylib.org
Apache License 2.0
228 stars 32 forks source link

[JOSS] Cross-reference functions in documentation #17

Closed blsqr closed 3 years ago

blsqr commented 3 years ago

First off: what I've read of the documentation so far is very nicely written 👍

I think what would further improve it would be cross-references to the API documentation. For instance, in working.rst, a link to init_simple would be very useful, I think, as it allows to check out the function signature and other available arguments.

You already have the API reference as part of your documentation via automodule, if I see it correctly. To reference to it, you can use the domain syntax. For instance, :py:func: can be used to reference a function:

The initial conditions are instantiated using the function
:py:func:`~cellpylib.ca_functions.init_simple`, which, in this example ...

which yields a link to the API docs when rendered:

Screenshot 2021-09-24 at 16 08 50

I would propose to do this across all of the docs, as it really reduces friction, makes the functions stand out more, and makes the docs overall more useful. I think this could be applied semi-automatically across many files of the docs using search-and-replace, such that workload does not go over the top?

blsqr commented 3 years ago

Also, I would propose to consistently use the verbatim sphinx markup (double-backticks) when referring to function arguments, e.g.:

Any function that accepts the three arguments ``n``, ``c`` and ``t``
can be supplied as a rule, but in this case the built-in function
:py:func:`~cellpylib.ca_functions.nks_rule` is invoked to provide Rule 30.
lantunes commented 3 years ago

Thanks for pointing this out. I have updated the docs accordingly. The changes are on the joss_review branch.