File tree 1 file changed +24
-0
lines changed
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -315,6 +315,30 @@ This will build the HTML files in `doc/_build/html`.
315
315
Open ` doc/_build/html/index.html ` in your browser to view the pages. Follow the
316
316
[ pull request workflow] ( contributing.md#pull-request-workflow ) to submit your changes for review.
317
317
318
+ ### Adding example code
319
+
320
+ Many of the PyGMT functions have example code in their documentation. To contribute an
321
+ example, add an "Example" header and put the example code below it. Have all lines
322
+ begin with ` >>> ` . To keep this example code from being run during testing, add the code
323
+ ` __doctest_skip__ = [function name] ` to the top of the module.
324
+
325
+ ** Inline code example**
326
+
327
+ Below the import statements at the top of the file
328
+
329
+ ``
330
+ __ doctest_skip__ = [ "module_name"]
331
+ ``
332
+
333
+ At the end of the function's docstring
334
+
335
+ Example
336
+ -------
337
+ >>> import pygmt
338
+ >>> # Comment describing what is happening
339
+ >>> Code example
340
+
341
+
318
342
### Contributing Gallery Plots
319
343
320
344
The gallery and tutorials are managed by
You can’t perform that action at this time.
0 commit comments