Skip to content

Commit

Permalink
Reorganize gallery examples (#995)
Browse files Browse the repository at this point in the history
Changes in this PR:

- Reorganizes the gallery examples to have more specific categories
- Sort gallery examples by "title" in each subsection
- Use underscores in file and directory names

Co-authored-by: Dongdong Tian <[email protected]>
Co-authored-by: Michael Grund <[email protected]>
Co-authored-by: Wei Ji <[email protected]>
Co-authored-by: Yao Jiayuan <[email protected]>
Co-authored-by: Meghan Jones <[email protected]>
  • Loading branch information
6 people authored Mar 12, 2021
1 parent 80b699d commit b2b3d1f
Show file tree
Hide file tree
Showing 36 changed files with 27 additions and 18 deletions.
15 changes: 9 additions & 6 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# isort: off
from sphinx_gallery.sorting import ( # pylint: disable=no-name-in-module
ExplicitOrder,
FileNameSortKey,
ExampleTitleSortKey,
)
from pygmt import __commit__, __version__
from pygmt.sphinx_gallery import PyGMTScraper
Expand Down Expand Up @@ -71,10 +71,13 @@
"gallery_dirs": ["gallery", "tutorials", "projections"],
"subsection_order": ExplicitOrder(
[
"../examples/gallery/line",
"../examples/gallery/coast",
"../examples/gallery/plot",
"../examples/gallery/grid",
"../examples/gallery/maps",
"../examples/gallery/lines",
"../examples/gallery/symbols",
"../examples/gallery/images",
"../examples/gallery/3d_plots",
"../examples/gallery/seismology",
"../examples/gallery/embellishments",
"../examples/projections/azim",
"../examples/projections/conic",
"../examples/projections/cyl",
Expand All @@ -88,7 +91,7 @@
# Remove the "Download all examples" button from the top level gallery
"download_all_examples": False,
# Sort gallery example by file name instead of number of lines (default)
"within_subsection_order": FileNameSortKey,
"within_subsection_order": ExampleTitleSortKey,
# directory where function granular galleries are stored
"backreferences_dir": "api/generated/backreferences",
# Modules for which function level galleries are created. In
Expand Down
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
tutorials/contour-map.rst
tutorials/earth-relief.rst
tutorials/3d-perspective-image.rst
tutorials/inset.rst
tutorials/insets.rst
tutorials/subplots.rst
tutorials/configuration.rst

Expand Down
2 changes: 2 additions & 0 deletions examples/gallery/3d_plots/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
3D Plots
--------
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions examples/gallery/coast/README.txt

This file was deleted.

2 changes: 2 additions & 0 deletions examples/gallery/embellishments/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Plot embellishments
-------------------
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions examples/gallery/grid/README.txt

This file was deleted.

2 changes: 2 additions & 0 deletions examples/gallery/images/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Images, contours, and fields
----------------------------
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions examples/gallery/line/README.txt

This file was deleted.

2 changes: 2 additions & 0 deletions examples/gallery/lines/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Lines and vectors
-----------------
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
In the following we use the :meth:`pygmt.Figure.plot` method to plot vectors
with individual heads and tails. We must specify the modifiers (together with
the vector type, here ``v``, see also
:doc:`Vector types documentation </gallery/line/vectors>`)
:doc:`Vector types documentation </gallery/lines/vectors>`)
by passing the corresponding shortcuts to the ``style`` parameter.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
The :meth:`pygmt.Figure.plot` method can plot Cartesian, circular, and geographic vectors.
The ``style`` parameter controls vector attributes. See also
:doc:`Vector attributes documentation </gallery/line/vector-heads-tails>`.
:doc:`Vector attributes documentation </gallery/lines/vector_heads_tails>`.
"""
import numpy as np
Expand Down
2 changes: 2 additions & 0 deletions examples/gallery/maps/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Maps and map elements
---------------------
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions examples/gallery/plot/README.txt

This file was deleted.

2 changes: 2 additions & 0 deletions examples/gallery/seismology/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Seismology and geodesy
----------------------
File renamed without changes.
2 changes: 2 additions & 0 deletions examples/gallery/symbols/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Symbols and markers
-------------------
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/tutorials/lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
# example below, the line width is set to ``7p``, the color is set to ``green``, and the
# line style is ``-.-`` (*dash dot dash*).
#
# For a gallery showing other ``pen`` settings, see :doc:`/gallery/line/linestyles`.
# For a gallery showing other ``pen`` settings, see :doc:`/gallery/lines/linestyles`.

fig = pygmt.Figure()
fig.plot(
Expand Down

0 comments on commit b2b3d1f

Please sign in to comment.