Skip to content

Commit

Permalink
Expand documentation linking in CONTRIBUTING.md (GenericMappingTools#802
Browse files Browse the repository at this point in the history
)

Co-authored-by: Dongdong Tian <[email protected]>
Co-authored-by: Meghan Jones <[email protected]>
Co-authored-by: Wei Ji <[email protected]>
  • Loading branch information
4 people authored and Josh Sixsmith committed Dec 21, 2022
1 parent 620b3a2 commit f3a4589
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,34 @@ The API reference is manually assembled in `doc/api/index.rst`.
The *autodoc* sphinx extension will automatically create pages for each
function/class/module listed there.

You can reference classes, functions, and modules from anywhere (including docstrings)
using <code>:func:\`package.module.function\`</code>,
<code>:class:\`package.module.class\`</code>, or
<code>:mod:\`package.module\`</code>.
You can reference functions, classes, methods, and modules from anywhere
(including docstrings) using:

- <code>:func:\`package.module.function\`</code>
- <code>:class:\`package.module.class\`</code>
- <code>:meth:\`package.module.method\`</code>
- <code>:mod:\`package.module\`</code>

An example would be to use
<code>:meth:\`pygmt.Figure.grdview\`</code> to link
to https://www.pygmt.org/latest/api/generated/pygmt.Figure.grdview.html.
PyGMT documentation that is not a class, method,
or module can be linked with <code>:doc:\`Any Link Text </path/to/the/file>\`</code>.
For example, <code>:doc:\`Install instructions \</install\>\`</code> links
to https://www.pygmt.org/latest/install.html.

Linking to the GMT documentation and GMT configuration parameters can be done using:

- <code>:gmt-docs:\`page_name.html\`</code>
- <code>:gmt-term:\`GMT_PARAMETER\`</code>

An example would be using
<code>:gmt-docs:\`makecpt.html\`</code> to link to
https://docs.generic-mapping-tools.org/latest/makecpt.html.
For GMT configuration parameters, an example is
<code>:gmt-term:\`COLOR_FOREGROUND\`</code> to link to
https://docs.generic-mapping-tools.org/latest/gmt.conf.html#term-COLOR_FOREGROUND.

Sphinx will create a link to the automatically generated page for that
function/class/module.

Expand Down

0 comments on commit f3a4589

Please sign in to comment.