Skip to content

Commit a97c1d8

Browse files
authored
Merge pull request #365 from splunk/fix-docs-gen
Fix duplicate TOC in Sphinx docs and automate bundling of docs
2 parents 752527b + 73c0dae commit a97c1d8

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ build_app:
2828
@echo "$(ATTN_COLOR)==> build_app $(NO_COLOR)"
2929
@python setup.py build dist
3030

31+
.PHONY: docs
32+
docs:
33+
@echo "$(ATTN_COLOR)==> docs $(NO_COLOR)"
34+
@rm -rf ./docs/_build
35+
@tox -e docs
36+
@cd ./docs/_build/html && zip -r ../docs_html.zip . -x ".*" -x "__MACOSX"
37+
@echo "$(ATTN_COLOR)==> Docs pages can be found at ./docs/_build/html, docs bundle available at ./docs/_build/docs_html.zip"
38+
3139
.PHONY: test
3240
test:
3341
@echo "$(ATTN_COLOR)==> test $(NO_COLOR)"

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
# Custom sidebar templates, maps document names to template names.
139139
#html_sidebars = {
140140
html_sidebars = {
141-
'**': ['localtoc.html', 'globaltoc.html', 'searchbox.html'],
141+
'**': ['globaltoc.html', 'searchbox.html'],
142142
}
143143

144144
# Additional templates that should be rendered to pages, maps page names to

tox.ini

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = clean,py27,py37
2+
envlist = clean,docs,py27,py37
33
skipsdist = {env:TOXBUILD:false}
44

55
[testenv:pep8]
@@ -26,7 +26,7 @@ application-import-names = splunk-sdk-python
2626
passenv = LANG
2727
setenv = SPLUNK_HOME=/opt/splunk
2828
INPUT_EXAMPLE_UPLOAD=/opt/splunk/var/log/splunk/splunkd_ui_access.log
29-
whitelist_externals = true
29+
allowlist_externals = make
3030
deps = pytest
3131
pytest-cov
3232
xmlrunner
@@ -41,3 +41,9 @@ commands =
4141
deps = coverage
4242
skip_install = true
4343
commands = coverage erase
44+
45+
[testenv:docs]
46+
description = invoke sphinx-build to build the HTML docs
47+
basepython = python3.7
48+
deps = sphinx >= 1.7.5, < 2
49+
commands = make -C docs/ html

0 commit comments

Comments
 (0)