Skip to content

Commit c88e3ce

Browse files
committed
Allow better usage of docs locally.
This will default to the rtd theme and introduces tox -e docs for generating docs locally.
1 parent 3ab9a42 commit c88e3ce

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

docs/conf.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,3 +262,10 @@
262262

263263
# If true, do not generate a @detailmenu in the "Top" node's menu.
264264
#texinfo_no_detailmenu = False
265+
266+
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
267+
268+
if not on_rtd: # only import and set the theme if we're building docs locally
269+
import sphinx_rtd_theme
270+
html_theme = 'sphinx_rtd_theme'
271+
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

docs/index.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
kafka-python
32
============
43

@@ -51,11 +50,9 @@ Contents
5150
usage
5251
api_reference
5352

54-
5553
Indices and tables
5654
==================
5755

5856
* :ref:`genindex`
5957
* :ref:`modindex`
6058
* :ref:`search`
61-

tox.ini

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[tox]
2-
envlist = lint, py26, py27, pypy, py33, py34
2+
envlist = lint, py26, py27, pypy, py33, py34, docs
3+
34
[testenv]
45
deps =
56
six
@@ -37,3 +38,12 @@ deps =
3738
mock
3839
pylint
3940
commands = pylint {posargs: -E kafka test}
41+
42+
[testenv:docs]
43+
deps =
44+
sphinxcontrib-napoleon
45+
sphinx_rtd_theme
46+
sphinx
47+
48+
commands =
49+
sphinx-build -b html docs/ docs/_build

0 commit comments

Comments
 (0)