@@ -90,14 +90,14 @@ where you can submit general comments and/or questions:
90
90
* For general comments, select * New Topic* from the
91
91
[ Lounge Page] ( https://forum.generic-mapping-tools.org/c/lounge/6 ) .
92
92
* To share your work, select * New Topic* from the
93
- [ Showcase Page] ( https://forum.generic-mapping-tools.org/c/Sow -your-nice-example-script/10 ) .
93
+ [ Showcase Page] ( https://forum.generic-mapping-tools.org/c/Show -your-nice-example-script/10 ) .
94
94
95
95
## General Guidelines
96
96
97
97
### Resources for New Contributors
98
98
99
99
Please take a look at these resources to learn about Git and pull requests (don't
100
- hesitate to [ ask questions] ( #getting-help ) ):
100
+ hesitate to [ ask questions] ( contributing.md #getting-help) ):
101
101
102
102
* [ How to Contribute to Open Source] ( https://opensource.guide/how-to-contribute/ ) .
103
103
* [ Git Workflow Tutorial] ( http://www.asmeurer.com/git-workflow/ ) by Aaron Meurer.
@@ -161,29 +161,30 @@ To increase the chances of getting your pull request accepted quickly, try to:
161
161
- Write some documentation for your code (docstrings) and leave comments
162
162
explaining the * reason* behind non-obvious things.
163
163
- Write tests for the code you wrote/modified if needed.
164
- Please refer to [ Testing your code] ( #testing-your-code ) or
165
- [ Testing plots] ( #testing-plots ) .
164
+ Please refer to [ Testing your code] ( contributing.md #testing-your-code) or
165
+ [ Testing plots] ( contributing.md #testing-plots) .
166
166
- Include an example of new features in the gallery or tutorials.
167
- Please refer to [ Gallery plots] ( #gallery-plots ) or [ Tutorials] ( #tutorials ) .
167
+ Please refer to [ Gallery plots] ( contributing.md#contributing-gallery-plots )
168
+ or [ Tutorials] ( contributing.md#contributing-tutorials ) .
168
169
* Have a good coding style
169
170
- Use readable code, as it is better than clever code (even with comments).
170
171
- Follow the [ PEP8] ( http://pep8.org ) style guide for code and the
171
172
[ NumPy style guide] ( https://numpydoc.readthedocs.io/en/latest/format.html )
172
- for docstrings. Please refer to [ Code style] ( #code-style ) .
173
+ for docstrings. Please refer to [ Code style] ( contributing.md #code-style) .
173
174
174
175
Pull requests will automatically have tests run by GitHub Actions.
175
176
This includes running both the unit tests as well as code linters.
176
177
GitHub will show the status of these checks on the pull request.
177
178
Try to get them all passing (green).
178
179
If you have any trouble, leave a comment in the PR or
179
- [ get in touch] ( #how-can-i-talk-to-you ) .
180
+ [ get in touch] ( contributing.md#getting-help ) .
180
181
181
182
## Setting up your Environment
182
183
183
184
These steps for setting up your environment are necessary for
184
- [ editing the documentation locally] ( #editing-the-documentation-locally ) and
185
- [ contributing code] ( #contributing-code ) . A local PyGMT development environment
186
- is not needed for [ editing the documentation on GitHub] ( #editing-the-documentation-on-github ) .
185
+ [ editing the documentation locally] ( contributing.md #editing-the-documentation-locally) and
186
+ [ contributing code] ( contributing.md #contributing-code) . A local PyGMT development environment
187
+ is not needed for [ editing the documentation on GitHub] ( contributing.md #editing-the-documentation-on-github) .
187
188
188
189
We highly recommend using [ Anaconda] ( https://www.anaconda.com/download/ ) and the ` conda `
189
190
package manager to install and manage your Python packages.
@@ -244,24 +245,24 @@ There are four main components to PyGMT's documentation:
244
245
The documentation are written primarily in
245
246
[ reStructuredText] ( https://docutils.sourceforge.io/rst.html ) and built by
246
247
[ Sphinx] ( http://www.sphinx-doc.org/ ) . Please refer to
247
- [ reStructuredText Cheatsheet] ( https://docs.generic-mapping-tools.org/latest/ devdocs/rst-cheatsheet.html)
248
+ {gmt-docs} ` reStructuredText Cheatsheet < devdocs/rst-cheatsheet.html> `
248
249
if you are new to reStructuredText. When contributing documentation, be sure to
249
- follow the general guidelines in the [ pull request workflow] ( #pull-request-workflow )
250
+ follow the general guidelines in the [ pull request workflow] ( contributing.md #pull-request-workflow)
250
251
section.
251
252
252
253
There are two primary ways to edit the PyGMT documentation:
253
254
- For simple documentation changes, you can easily
254
- [ edit the documentation on GitHub] ( #editing-the-documentation-on-github ) .
255
+ [ edit the documentation on GitHub] ( contributing.md #editing-the-documentation-on-github) .
255
256
This only requires you to have a GitHub account.
256
257
- For more complicated changes, you can
257
- [ edit the documentation locally] ( #editing-the-documentation-locally ) .
258
+ [ edit the documentation locally] ( contributing.md #editing-the-documentation-locally) .
258
259
In order to build the documentation locally, you first need to
259
- [ set up your environment] ( #setting-up-your-environment ) .
260
+ [ set up your environment] ( contributing.md #setting-up-your-environment) .
260
261
261
262
### Editing the Documentation on GitHub
262
263
263
264
If you're browsing the documentation and notice a typo or something that could be
264
- improved, please consider letting us know by [ creating an issue] ( #reporting-a-bug ) or
265
+ improved, please consider letting us know by [ creating an issue] ( contributing.md #reporting-a-bug) or
265
266
(even better) submitting a fix.
266
267
267
268
You can submit fixes to the documentation pages completely online without having to
@@ -288,14 +289,14 @@ download and install anything:
288
289
9 . Done!
289
290
290
291
Alternatively, you can make the changes offline to the files in the ` doc ` folder or the
291
- example scripts. See [ editing the documentation locally] ( #editing-the-documentation-locally )
292
+ example scripts. See [ editing the documentation locally] ( contributing.md #editing-the-documentation-locally)
292
293
for instructions.
293
294
294
295
### Editing the Documentation Locally
295
296
296
297
For more extensive changes, you can edit the documentation in your cloned repository
297
298
and build the documentation to preview changes before submitting a pull request. First,
298
- follow the [ setting up your environment] ( #setting-up-your-environment ) instructions.
299
+ follow the [ setting up your environment] ( contributing.md #setting-up-your-environment) instructions.
299
300
After making your changes, you can build the HTML files from sources using:
300
301
301
302
``` bash
@@ -305,15 +306,15 @@ make all
305
306
306
307
This will build the HTML files in ` doc/_build/html ` .
307
308
Open ` doc/_build/html/index.html ` in your browser to view the pages. Follow the
308
- [ pull request workflow] ( #pull-request-workflow ) to submit your changes for review.
309
+ [ pull request workflow] ( contributing.md #pull-request-workflow) to submit your changes for review.
309
310
310
311
### Contributing Gallery Plots
311
312
312
313
The gallery and tutorials are managed by
313
314
[ sphinx-gallery] ( https://sphinx-gallery.readthedocs.io/ ) .
314
315
The source files for the example gallery are ` .py ` scripts in ` examples/gallery/ ` that
315
316
generate one or more figures. They are executed automatically by sphinx-gallery when
316
- the [ documentation is built] ( #building -the-documentation) . The output is gathered and
317
+ the [ documentation is built] ( contributing.md#editing -the-documentation-locally ) . The output is gathered and
317
318
assembled into the gallery.
318
319
319
320
You can ** add a new** plot by placing a new ` .py ` file in one of the folders inside the
@@ -421,11 +422,10 @@ Linking to the GMT documentation and GMT configuration parameters can be done us
421
422
- <code >:gmt-term:\` GMT_PARAMETER\` </code >
422
423
423
424
An example would be using
424
- <code >:gmt-docs:\` makecpt.html\` </code > to link to
425
- [ https://docs.generic-mapping-tools.org/latest/makecpt.html ] ( https://docs.generic-mapping-tools.org/latest/makecpt.html ) .
425
+ <code >:gmt-docs:\` makecpt.html\` </code > to link to {gmt-docs}` makecpt.html ` .
426
426
For GMT configuration parameters, an example is
427
427
<code >:gmt-term:\` COLOR_FOREGROUND\` </code > to link to
428
- [ https://docs.generic-mapping-tools.org/latest/ gmt.conf.html#term-COLOR_FOREGROUND ] ( https://docs.generic-mapping-tools.org/latest/gmt.conf.html #term-COLOR_FOREGROUND ) .
428
+ { gmt-term} ` https://docs.generic-mapping-tools.org/latest/gmt.conf#term-COLOR_FOREGROUND <COLOR_FOREGROUND> ` .
429
429
430
430
Sphinx will create a link to the automatically generated page for that
431
431
function/class/module.
@@ -436,7 +436,7 @@ function/class/module.
436
436
437
437
The source code for PyGMT is located in the ` pygmt/ ` directory. When contributing
438
438
code, be sure to follow the general guidelines in the
439
- [ pull request workflow] ( #pull-request-workflow ) section.
439
+ [ pull request workflow] ( contributing.md #pull-request-workflow) section.
440
440
441
441
### Code Style
442
442
0 commit comments