Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ build_app:
@echo "$(ATTN_COLOR)==> build_app $(NO_COLOR)"
@python setup.py build dist

.PHONY: docs
docs:
@echo "$(ATTN_COLOR)==> docs $(NO_COLOR)"
@rm -rf ./docs/_build
@tox -e docs
@cd ./docs/_build/html && zip -r ../docs_html.zip . -x ".*" -x "__MACOSX"
@echo "$(ATTN_COLOR)==> Docs pages can be found at ./docs/_build/html, docs bundle available at ./docs/_build/docs_html.zip"

.PHONY: test
test:
@echo "$(ATTN_COLOR)==> test $(NO_COLOR)"
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {
html_sidebars = {
'**': ['localtoc.html', 'globaltoc.html', 'searchbox.html'],
'**': ['globaltoc.html', 'searchbox.html'],
}

# Additional templates that should be rendered to pages, maps page names to
Expand Down
10 changes: 8 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = clean,py27,py37
envlist = clean,docs,py27,py37
skipsdist = {env:TOXBUILD:false}

[testenv:pep8]
Expand All @@ -26,7 +26,7 @@ application-import-names = splunk-sdk-python
passenv = LANG
setenv = SPLUNK_HOME=/opt/splunk
INPUT_EXAMPLE_UPLOAD=/opt/splunk/var/log/splunk/splunkd_ui_access.log
whitelist_externals = true
allowlist_externals = make
Copy link
Contributor Author

@fantavlik fantavlik Jan 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tells tox that it's OK to run make in the docs command below, see: https://tox.readthedocs.io/en/latest/example/basic.html?highlight=make#allowing-non-virtualenv-commands

deps = pytest
pytest-cov
xmlrunner
Expand All @@ -41,3 +41,9 @@ commands =
deps = coverage
skip_install = true
commands = coverage erase

[testenv:docs]
description = invoke sphinx-build to build the HTML docs
basepython = python3.7
deps = sphinx >= 1.7.5, < 2
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By running this as a tox command we can let tox install sphinx in a Python 3 environment and skip those steps as part of docs generation

commands = make -C docs/ html