Skip to content

Commit 00ab41d

Browse files
authored
doc: Set theme in conf.py (#1239)
1 parent 9127d60 commit 00ab41d

File tree

2 files changed

+39
-5
lines changed

2 files changed

+39
-5
lines changed

README.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,43 @@ You can also run them in parallel:
155155
tox -- -n auto tests/integ
156156

157157

158+
Building Sphinx docs
159+
~~~~~~~~~~~~~~~~~~~~
160+
161+
Setup a Python environment with ``sphinx`` and ``sagemaker``:
162+
163+
::
164+
165+
conda create -n sagemaker python=3.7
166+
conda activate sagemaker
167+
conda install sphinx==2.2.2
168+
pip install sagemaker --user
169+
170+
Install the Read The Docs theme:
171+
172+
::
173+
174+
pip install sphinx_rtd_theme --user
175+
176+
177+
Clone/fork the repo, ``cd`` into the ``sagemaker-python-sdk/doc`` directory and run:
178+
179+
::
180+
181+
make html
182+
183+
You can edit the templates for any of the pages in the docs by editing the .rst files in the ``doc`` directory and then running ``make html`` again.
184+
185+
Preview the site with a Python web server:
186+
187+
::
188+
189+
cd _build/html
190+
python -m http.server 8000
191+
192+
View the website by visiting http://localhost:8000
193+
194+
158195
MXNet SageMaker Estimators
159196
--------------------------
160197

doc/conf.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"""Placeholder docstring"""
1414
from __future__ import absolute_import
1515

16-
import os
1716
import pkg_resources
1817
import sys
1918
from datetime import datetime
@@ -83,10 +82,8 @@ def __getattr__(cls, name):
8382
autodoc_default_flags = ["show-inheritance", "members", "undoc-members"]
8483
autodoc_member_order = "bysource"
8584

86-
if "READTHEDOCS" in os.environ:
87-
html_theme = "default"
88-
else:
89-
html_theme = "haiku"
85+
html_theme = "sphinx_rtd_theme"
86+
9087
html_static_path = []
9188
htmlhelp_basename = "%sdoc" % project
9289

0 commit comments

Comments
 (0)