Skip to content

Commit d8ec308

Browse files
weiji14seisman
authored and
Josh Sixsmith
committed
Migrate Continuous Documentation from Vercel to Readthedocs (GenericMappingTools#1859)
* Remove vercel configuration files * Setup readthedocs configuration file * Run pip install . in the readthedocs build environment * Remove vercel configurations and add readthedocs configurations in MANIFEST.in * Update doc/maintenance.md to trigger builds in PR * Set canonical URL by setting html_baseurl * Update contributing and maintenance guides * Customize the pre_build step to generate API stub files * Only install packages required for building docs * Move the docs environment file to the ci directory Co-authored-by: Dongdong Tian <[email protected]>
1 parent 86a38fd commit d8ec308

File tree

8 files changed

+64
-24
lines changed

8 files changed

+64
-24
lines changed

.readthedocs.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Read the Docs configuration file
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the version of Python and other tools you might need
8+
build:
9+
os: ubuntu-20.04
10+
tools:
11+
python: "mambaforge-4.10"
12+
jobs:
13+
pre_build: # Generate api stub files before building
14+
- make -C doc api
15+
16+
# Build documentation in the doc/ directory with Sphinx
17+
sphinx:
18+
configuration: doc/conf.py
19+
20+
# If using Sphinx, optionally build your docs in additional formats such as PDF
21+
# formats:
22+
# - pdf
23+
24+
# Optionally declare the Python requirements required to build your docs
25+
conda:
26+
environment: ci/requirements/docs.yml
27+
python:
28+
install:
29+
- method: pip
30+
path: .

MANIFEST.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
prune .dvc
22
prune .github*
3+
prune ci
34
prune doc*
45
prune examples*
56
exclude .dvcignore
67
exclude .gitignore
8+
exclude .readthedocs.yaml
79
exclude AUTHORSHIP.md
810
exclude CONTRIBUTING.md
911
exclude Makefile
1012
exclude environment.yml
11-
exclude package.json
1213
exclude requirements.txt
13-
exclude vercel.json

ci/requirements/docs.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: pygmt
2+
channels:
3+
- conda-forge
4+
- defaults
5+
dependencies:
6+
# Required dependencies
7+
- pip
8+
- gmt=6.3.0
9+
- numpy>=1.20
10+
- pandas
11+
- xarray
12+
- netCDF4
13+
- packaging
14+
# Optional dependencies
15+
- geopandas
16+
# Development dependencies (general)
17+
- build
18+
- ipython
19+
- make
20+
# Dev dependencies (building documentation)
21+
- myst-parser
22+
- sphinx
23+
- sphinx-copybutton
24+
- sphinx-design
25+
- sphinx-gallery
26+
- sphinx_rtd_theme

doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142
.. |year| replace:: {year}
143143
"""
144144

145+
html_baseurl = "https://pygmt.org/latest/"
145146
html_last_updated_fmt = "%b %d, %Y"
146147
html_title = "PyGMT"
147148
html_short_title = "PyGMT"

doc/contributing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ download and install anything:
289289
click on the "Propose changes" button to open a pull request.
290290
7. The pull request will run the GMT automated tests and make a preview deployment.
291291
You can see how your change looks in the PyGMT documentation by clicking the
292-
"View deployment" button after the Vercel bot has finished (usually 5-10 minutes
293-
after the pull request was created).
292+
"Details" button of the "docs/readthedocs.org:pygmt-dev" status check,
293+
after the building has finished (usually 10-15 minutes after the pull request was created).
294294
8. We'll review your pull request, recommend changes if necessary, and then merge
295295
them in if everything is OK.
296296
9. Done!

doc/maintenance.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,10 @@ There are 11 configuration files located in `.github/workflows`:
151151

152152
## Continuous Documentation
153153

154-
We use the [Vercel for GitHub](https://github.com/apps/vercel) App to preview changes
154+
We use the [ReadtheDocs](https://readthedocs.org/) service to preview changes
155155
made to our documentation website every time we make a commit in a pull request.
156-
The service has a configuration file `vercel.json`, with a list of options to
157-
change the default behaviour at https://vercel.com/docs/configuration.
158-
The actual script `package.json` is used by Vercel to install the necessary packages,
159-
build the documentation, copy the files to a 'public' folder and deploy that to the web,
160-
see https://vercel.com/docs/build-step.
156+
The service has a configuration file `.readthedocs.yaml`, with a list of options
157+
to change the default behaviour at https://docs.readthedocs.io/en/stable/config-file/index.html.
161158

162159

163160
## Dependencies Policy

package.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

vercel.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)