Skip to content

Commit f228cdf

Browse files
Meghan Jonesweiji14
Meghan Jones
andauthored
Reorganize tutorial section in the documentation sidebar (#1603)
Co-authored-by: Wei Ji <[email protected]>
1 parent 46fc49e commit f228cdf

23 files changed

+24
-36
lines changed

doc/conf.py

+2
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@
8787
"../examples/projections/misc",
8888
"../examples/projections/nongeo",
8989
"../examples/projections/table",
90+
"../examples/tutorials/basics",
91+
"../examples/tutorials/advanced",
9092
]
9193
),
9294
# Patter to search for example files

doc/contributing.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -343,12 +343,9 @@ General guidelines for making a good gallery plot:
343343
The tutorials (the User Guide in the docs) are also built by sphinx-gallery from the
344344
`.py` files in the `examples/tutorials` folder of the repository. To add a new tutorial:
345345

346-
* Include a `.py` file in the `examples/tutorials` folder on the base of the repository.
346+
* Create a `.py` file in the `examples/tutorials/advanced` folder.
347347
* Write the tutorial in "notebook" style with code mixed with paragraphs explaining what
348348
is being done. See the other tutorials for the format.
349-
* Include the tutorial in the table of contents of the documentation (side bar). Do this
350-
by adding a line to the User Guide `toc` directive in `doc/index.rst`. Notice that the
351-
file included is the `.rst` generated by sphinx-gallery.
352349
* Choose the most representative figure as the thumbnail figure by adding a comment line
353350
`# sphinx_gallery_thumbnail_number = <fig_number>` to any place (usually at the top)
354351
in the tutorial. The *fig_number* starts from 1.

doc/index.rst

+4-23
Original file line numberDiff line numberDiff line change
@@ -20,36 +20,17 @@
2020

2121
overview.rst
2222
install.rst
23-
tutorials/first_figure.rst
24-
25-
.. toctree::
26-
:maxdepth: 2
27-
:hidden:
28-
:caption: Examples
29-
30-
gallery/index.rst
31-
external_resources.md
23+
tutorials/basics/first_figure.rst
3224

3325
.. toctree::
3426
:maxdepth: 2
3527
:hidden:
3628
:caption: User Guide
3729

38-
tutorials/frames.rst
30+
tutorials/index.rst
31+
gallery/index.rst
3932
projections/index.rst
40-
tutorials/coastlines.rst
41-
tutorials/regions.rst
42-
tutorials/plot.rst
43-
tutorials/lines.rst
44-
tutorials/vectors.rst
45-
tutorials/date_time_charts.rst
46-
tutorials/text.rst
47-
tutorials/contour_map.rst
48-
tutorials/earth_relief.rst
49-
tutorials/3d_perspective_image.rst
50-
tutorials/insets.rst
51-
tutorials/subplots.rst
52-
tutorials/configuration.rst
33+
external_resources.md
5334

5435
.. toctree::
5536
:maxdepth: 2

examples/tutorials/README.txt

+4
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
.. _tutorials:
2+
13
Tutorials
24
=========
5+
6+
These examples teach us how to complete various tasks using PyGMT!
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Advanced
2+
--------

examples/tutorials/date_time_charts.py renamed to examples/tutorials/advanced/date_time_charts.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
The following examples will demonstrate how to create plots
1212
using the different datetime objects.
1313
"""
14-
# sphinx_gallery_thumbnail_number = 0
14+
# sphinx_gallery_thumbnail_number = 8
1515

1616
import datetime
1717

@@ -285,7 +285,7 @@
285285
# Starting off with ``WS``, adding this string means that only
286286
# Western/Left (**W**) and Southern/Bottom (**S**) borders of
287287
# the plot will be shown. For more information on this, please
288-
# refer to :doc:`frame instructions </tutorials/frames>`.
288+
# refer to :doc:`frame instructions </tutorials/basics/frames>`.
289289
#
290290
# The other important item in the ``frame`` list is
291291
# ``"sxa1Of1D"``. This string modifies the secondary
File renamed without changes.

examples/tutorials/basics/README.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Basics
2+
------
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

pygmt/helpers/decorators.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"R": r"""
1919
region : str or list
2020
*xmin/xmax/ymin/ymax*\ [**+r**][**+u**\ *unit*].
21-
Specify the :doc:`region </tutorials/regions>` of interest.""",
21+
Specify the :doc:`region </tutorials/basics/regions>` of interest.""",
2222
"J": r"""
2323
projection : str
2424
*projcode*\[*projparams*/]\ *width*.
@@ -34,7 +34,7 @@
3434
"B": r"""
3535
frame : bool or str or list
3636
Set map boundary
37-
:doc:`frame and axes attributes </tutorials/frames>`. """,
37+
:doc:`frame and axes attributes </tutorials/basics/frames>`. """,
3838
"U": """\
3939
timestamp : bool or str
4040
Draw GMT time stamp logo on plot.""",
@@ -447,7 +447,7 @@ def fmt_docstring(module_func):
447447
tabular data.
448448
region : str or list
449449
*xmin/xmax/ymin/ymax*\ [**+r**][**+u**\ *unit*].
450-
Specify the :doc:`region </tutorials/regions>` of interest.
450+
Specify the :doc:`region </tutorials/basics/regions>` of interest.
451451
projection : str
452452
*projcode*\[*projparams*/]\ *width*.
453453
Select map :doc:`projection </projections/index>`.

pygmt/src/grdview.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ def grdview(self, grid, **kwargs):
6161
DataArray.
6262
region : str or list
6363
*xmin/xmax/ymin/ymax*\ [**+r**][**+u**\ *unit*].
64-
Specify the :doc:`region </tutorials/regions>` of interest. When used
65-
with ``perspective``, optionally append */zmin/zmax* to indicate the
66-
range to use for the 3-D axes [Default is the region in the input
67-
grid].
64+
Specify the :doc:`region </tutorials/basics/regions>` of interest.
65+
When used with ``perspective``, optionally append */zmin/zmax* to
66+
indicate the range to use for the 3-D axes [Default is the region in
67+
the input grid].
6868
{J}
6969
zscale/zsize : float or str
7070
Set z-axis scaling or z-axis size.

0 commit comments

Comments
 (0)