Skip to content

Commit a4a3721

Browse files
willschlitzerseismanMeghan Jonesweiji14
authored
Expand documentation linking in CONTRIBUTING.md (#802)
Co-authored-by: Dongdong Tian <[email protected]> Co-authored-by: Meghan Jones <[email protected]> Co-authored-by: Wei Ji <[email protected]>
1 parent 2ac5a1b commit a4a3721

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

CONTRIBUTING.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -441,10 +441,34 @@ The API reference is manually assembled in `doc/api/index.rst`.
441441
The *autodoc* sphinx extension will automatically create pages for each
442442
function/class/module listed there.
443443

444-
You can reference classes, functions, and modules from anywhere (including docstrings)
445-
using <code>:func:\`package.module.function\`</code>,
446-
<code>:class:\`package.module.class\`</code>, or
447-
<code>:mod:\`package.module\`</code>.
444+
You can reference functions, classes, methods, and modules from anywhere
445+
(including docstrings) using:
446+
447+
- <code>:func:\`package.module.function\`</code>
448+
- <code>:class:\`package.module.class\`</code>
449+
- <code>:meth:\`package.module.method\`</code>
450+
- <code>:mod:\`package.module\`</code>
451+
452+
An example would be to use
453+
<code>:meth:\`pygmt.Figure.grdview\`</code> to link
454+
to https://www.pygmt.org/latest/api/generated/pygmt.Figure.grdview.html.
455+
PyGMT documentation that is not a class, method,
456+
or module can be linked with <code>:doc:\`Any Link Text </path/to/the/file>\`</code>.
457+
For example, <code>:doc:\`Install instructions \</install\>\`</code> links
458+
to https://www.pygmt.org/latest/install.html.
459+
460+
Linking to the GMT documentation and GMT configuration parameters can be done using:
461+
462+
- <code>:gmt-docs:\`page_name.html\`</code>
463+
- <code>:gmt-term:\`GMT_PARAMETER\`</code>
464+
465+
An example would be using
466+
<code>:gmt-docs:\`makecpt.html\`</code> to link to
467+
https://docs.generic-mapping-tools.org/latest/makecpt.html.
468+
For GMT configuration parameters, an example is
469+
<code>:gmt-term:\`COLOR_FOREGROUND\`</code> to link to
470+
https://docs.generic-mapping-tools.org/latest/gmt.conf.html#term-COLOR_FOREGROUND.
471+
448472
Sphinx will create a link to the automatically generated page for that
449473
function/class/module.
450474

0 commit comments

Comments
 (0)