diff --git a/docs/_static/img/source_link_1.png b/docs/_static/img/source_link_1.png new file mode 100644 index 0000000000..53febda7cb Binary files /dev/null and b/docs/_static/img/source_link_1.png differ diff --git a/docs/_static/img/source_link_2.png b/docs/_static/img/source_link_2.png new file mode 100644 index 0000000000..d5647cac60 Binary files /dev/null and b/docs/_static/img/source_link_2.png differ diff --git a/docs/modules/0_getting_started/3_how_to_contribute_main.rst b/docs/modules/0_getting_started/3_how_to_contribute_main.rst index 1e61760649..30e3001f36 100644 --- a/docs/modules/0_getting_started/3_how_to_contribute_main.rst +++ b/docs/modules/0_getting_started/3_how_to_contribute_main.rst @@ -107,6 +107,18 @@ mathematics and the algorithm of the example. Documentations related codes should be in the python script as the header comments of the script or docstrings of each function. +Also, each document should have a link to the code in Github. +You can easily add the link by using the `.. autoclass::`, `.. autofunction::`, and `.. automodule` by Sphinx's `autodoc`_ module. + +Using this `autodoc`_ module, the generated documentations have the link to the code in Github like: + +.. image:: /_static/img/source_link_1.png + +When you click the link, you will jump to the source code in Github like: + +.. image:: /_static/img/source_link_2.png + + .. _`submit a pull request`: @@ -210,5 +222,6 @@ Current Major Sponsors: .. _`1Password`: https://github.com/1Password/for-open-source .. _`matplotrecorder`: https://github.com/AtsushiSakai/matplotrecorder .. _`PythonRoboticsGifs`: https://github.com/AtsushiSakai/PythonRoboticsGifs +.. _`autodoc`: https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 5438678f87..f3e6c3dc51 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -5,4 +5,4 @@ cvxpy == 1.5.3 pytest == 8.3.5 # For unit test pytest-xdist == 3.6.1 # For unit test mypy == 1.15.0 # For unit test -ruff == 0.11.0 # For unit test +ruff == 0.11.6 # For unit test