Skip to content

Commit caaa1cd

Browse files
Make comments more consistent | Rewrap line length
1 parent 39031c8 commit caaa1cd

File tree

1 file changed

+23
-27
lines changed

1 file changed

+23
-27
lines changed

doc/conf.py

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from pygmt.sphinx_gallery import PyGMTScraper
1212
from sphinx_gallery.sorting import ExampleTitleSortKey, ExplicitOrder
1313

14-
# Dictionary for dependency name and minimum required version.
14+
# Dictionary for dependency name and minimum required versions
1515
requirements = {
1616
Requirement(requirement).name: str(Requirement(requirement).specifier)
1717
for requirement in importlib.metadata.requires("pygmt")
@@ -50,7 +50,7 @@
5050

5151
# Auto-generate header anchors with MyST parser
5252
myst_heading_anchors = 4
53-
# reference: https://myst-parser.readthedocs.io/en/latest/syntax/optional.html
53+
# Reference: https://myst-parser.readthedocs.io/en/latest/syntax/optional.html
5454
myst_enable_extensions = [
5555
"attrs_inline", # Allow inline attributes after images
5656
"colon_fence", # Allow code fences using colons
@@ -61,26 +61,25 @@
6161
"requires": requirements,
6262
}
6363

64-
# MyST-NB configurations.
64+
# MyST-NB configurations
6565
# Reference: https://myst-nb.readthedocs.io/en/latest/configuration.html
66-
nb_render_markdown_format = "myst" # The format to use for text/markdown rendering
66+
nb_render_markdown_format = "myst" # Format for text/markdown rendering
6767

68-
# Make the list of returns arguments and attributes render the same as the
69-
# parameters list
68+
# Render the return argument and attribute lists in the same way as the parameter lists
7069
napoleon_use_rtype = False
7170
napoleon_use_ivar = True
7271

73-
# sphinx_auto_typehints
72+
# Configure sphinx_auto_typehints
7473
typehints_defaults = "comma"
7574

76-
# configure links to GMT docs
75+
# Define links to GMT docs
7776
extlinks = {
7877
"gmt-docs": ("https://docs.generic-mapping-tools.org/6.5/%s", None),
7978
"gmt-term": ("https://docs.generic-mapping-tools.org/6.5/gmt.conf#term-%s", "%s"),
8079
"gmt-datasets": ("https://www.generic-mapping-tools.org/remote-datasets/%s", None),
8180
}
8281

83-
# intersphinx configuration
82+
# Configure intersphinx
8483
intersphinx_mapping = {
8584
"contextily": ("https://contextily.readthedocs.io/en/stable/", None),
8685
"geopandas": ("https://geopandas.org/en/stable/", None),
@@ -93,22 +92,22 @@
9392
"xyzservices": ("https://xyzservices.readthedocs.io/en/stable", None),
9493
}
9594

96-
# options for sphinx-copybutton
97-
# https://sphinx-copybutton.readthedocs.io
95+
# Configure options for sphinx-copybutton
96+
# Reference: https://sphinx-copybutton.readthedocs.io
9897
copybutton_prompt_text = r">>> |\.\.\. "
9998
copybutton_prompt_is_regexp = True
10099
copybutton_only_copy_prompt_lines = True
101100
copybutton_remove_prompts = True
102101

103102
sphinx_gallery_conf = {
104-
# path to your examples scripts
103+
# Set paths to your examples scripts
105104
"examples_dirs": [
106105
"../examples/gallery",
107106
"../examples/tutorials",
108107
"../examples/get_started",
109108
"../examples/projections",
110109
],
111-
# path where to save gallery generated examples
110+
# Set paths where to save the generated examples
112111
"gallery_dirs": ["gallery", "tutorials", "get_started", "projections"],
113112
"subsection_order": ExplicitOrder(
114113
[
@@ -136,21 +135,19 @@
136135
"filename_pattern": r"\.py",
137136
# Remove the "Download all examples" button from the top level gallery
138137
"download_all_examples": False,
139-
# Sort gallery examples by file name instead of number of lines (default)
138+
# Sort gallery examples by the file names instead of number of lines [Default]
140139
"within_subsection_order": ExampleTitleSortKey,
141140
# Directory where function granular galleries are stored
142141
"backreferences_dir": "api/generated/backreferences",
143-
# Modules for which function level galleries are created. In
144-
# this case sphinx_gallery and numpy are a tuple of strings.
145-
"doc_module": "pygmt",
142+
# Modules for which function level galleries are created (given as tuple of strings)
143+
"doc_module": ("pygmt",),
146144
# Insert links to documentation of objects in the examples
147145
"reference_url": {"pygmt": None},
148146
"image_scrapers": (PyGMTScraper(),),
149147
# Remove configuration comments from scripts
150148
"remove_config_comments": True,
151-
# Disable "nested_sections" (default is True), to
152-
# generate only a single index file for the whole gallery.
153-
# This is a new feature up on Sphinx-Gallery 0.11.0.
149+
# Disable "nested_sections" [Default is True], to generate only a single index file
150+
# for the whole gallery. This is a new feature up on Sphinx-Gallery 0.11.0.
154151
"nested_sections": False,
155152
}
156153

@@ -160,7 +157,7 @@
160157
"_build",
161158
"**.ipynb_checkpoints",
162159
# Workaround from https://github.com/executablebooks/MyST-NB/issues/363 to prevent
163-
# myst-nb from parsing the .ipynb and .py files generated by sphinx-gallery.
160+
# MyST-NB from parsing the .ipynb and .py files generated by Sphinx-Gallery.
164161
"gallery/**.ipynb",
165162
"tutorials/**.ipynb",
166163
"get_started/**.ipynb",
@@ -173,7 +170,7 @@
173170

174171
source_suffix = ".rst"
175172
needs_sphinx = "1.8"
176-
# The encoding of source files.
173+
# Encoding of source files
177174
source_encoding = "utf-8-sig"
178175
root_doc = "index"
179176

@@ -183,11 +180,11 @@
183180
copyright = f"2017-{year}, The PyGMT Developers" # noqa: A001
184181
if len(__version__.split("+")) > 1 or __version__ == "unknown":
185182
version = "dev"
186-
# Set base_url for dev version
183+
# Set base URL for dev version
187184
html_baseurl = "https://pygmt.org/dev/"
188185
else:
189186
version = __version__
190-
# Set base_url for stable version
187+
# Set base URL for stable version
191188
html_baseurl = "https://pygmt.org/latest/"
192189
release = __version__
193190

@@ -205,7 +202,7 @@
205202
html_show_sphinx = False
206203
html_show_copyright = True
207204

208-
# Theme config
205+
# Theme configuration
209206
html_theme = "sphinx_rtd_theme"
210207
html_theme_options = {}
211208
repository = "GenericMappingTools/pygmt"
@@ -237,8 +234,7 @@
237234
repository_url,
238235
),
239236
],
240-
# Custom variables to enable "Improve this page"" and "Download notebook"
241-
# links
237+
# Custom variables to enable "Improve this page"" and "Download notebook" links
242238
"doc_path": "doc",
243239
"galleries": sphinx_gallery_conf["gallery_dirs"],
244240
"gallery_dir": dict(

0 commit comments

Comments
 (0)