Skip to content

Commit ba77131

Browse files
committed
ENH: Use our built version of sphinx_rtd_theme
This has support for choosing which version, so turn this on, with static configuration for latest and dev docs.
1 parent a744f6c commit ba77131

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,14 @@ matrix:
6060
before_install:
6161
# Shapely dependency needed to keep from using Shapely's manylinux wheels
6262
# which use a different geos that what we build cartopy with on Travis
63+
# We hardcode the sphinx_rtd_theme to lock in our build with patch for
64+
# version chooser
6365
- pip install --upgrade pip;
6466
- pip install --upgrade setuptools;
6567
- if [[ $TASK == "docs" ]]; then
6668
if ! git describe --tags; then git fetch --depth=150; fi;
6769
export EXTRA_INSTALLS="cdm,doc,examples";
68-
export EXTRA_PACKAGES="Cython pillow shapely<1.5.17.post1 sphinx_rtd_theme pytest recommonmark";
70+
export EXTRA_PACKAGES="Cython pillow shapely<1.5.17.post1 sphinx_rtd_theme==0.2.5b1.post1 pytest recommonmark";
6971
ls $HOME/local/lib/;
7072
if [[ ! -f $HOME/local/lib/libproj.so ]]; then
7173
wget http://download.osgeo.org/proj/proj-4.9.3.tar.gz;

docs/conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
}
6666

6767

68-
6968
# Turn off code and image links for embedded mpl plots
7069
plot_html_show_source_link = False
7170
plot_html_show_formats = False
@@ -108,7 +107,7 @@
108107
#
109108
# The short X.Y version.
110109
verinfo = metpy.__version__
111-
version = verinfo.split('+')[0]
110+
version = verinfo.split('+')[0].rsplit('.', maxsplit=1)[0]
112111
# The full version, including alpha/beta/rc tags.
113112
release = verinfo
114113

@@ -167,10 +166,12 @@
167166
def setup(app):
168167
app.add_stylesheet('theme_override.css')
169168

169+
170170
# Theme options are theme-specific and customize the look and feel of a theme
171171
# further. For a list of options available for each theme, see the
172172
# documentation.
173-
html_theme_options = {'canonical_url': 'https://unidata.github.io/MetPy/latest/'}
173+
html_theme_options = {'canonical_url': 'https://unidata.github.io/MetPy/latest/',
174+
'versions': {'latest': '../latest', 'dev': '../dev'}}
174175

175176
# Add any paths that contain custom themes here, relative to this directory.
176177
# html_theme_path = []

0 commit comments

Comments
 (0)