Skip to content

Commit 1c1596b

Browse files
authored
docs: enhance contribution guide with instructions for linking code in GitHub (#1202)
1 parent 764ba21 commit 1c1596b

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

docs/_static/img/source_link_1.png

85.9 KB
Loading

docs/_static/img/source_link_2.png

232 KB
Loading

docs/modules/0_getting_started/3_how_to_contribute_main.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,18 @@ mathematics and the algorithm of the example.
107107
Documentations related codes should be in the python script as the header
108108
comments of the script or docstrings of each function.
109109

110+
Also, each document should have a link to the code in Github.
111+
You can easily add the link by using the `.. autoclass::`, `.. autofunction::`, and `.. automodule` by Sphinx's `autodoc`_ module.
112+
113+
Using this `autodoc`_ module, the generated documentations have the link to the code in Github like:
114+
115+
.. image:: /_static/img/source_link_1.png
116+
117+
When you click the link, you will jump to the source code in Github like:
118+
119+
.. image:: /_static/img/source_link_2.png
120+
121+
110122

111123
.. _`submit a pull request`:
112124

@@ -210,5 +222,6 @@ Current Major Sponsors:
210222
.. _`1Password`: https://github.com/1Password/for-open-source
211223
.. _`matplotrecorder`: https://github.com/AtsushiSakai/matplotrecorder
212224
.. _`PythonRoboticsGifs`: https://github.com/AtsushiSakai/PythonRoboticsGifs
225+
.. _`autodoc`: https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html
213226

214227

0 commit comments

Comments
 (0)