diff --git a/docs/docsite/Makefile b/docs/docsite/Makefile deleted file mode 100644 index 19b665017a2..00000000000 --- a/docs/docsite/Makefile +++ /dev/null @@ -1,77 +0,0 @@ -OS := $(shell uname -s) -SITELIB = $(shell python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"): -ifeq ($(shell echo $(OS) | egrep -ic 'Darwin|FreeBSD|OpenBSD|DragonFly'),1) -CPUS ?= $(shell sysctl hw.ncpu|awk '{print $$2}') -else -CPUS ?= $(shell nproc) -endif - -# Sets the build output directory if it's not already specified -ifndef BUILDDIR - BUILDDIR = _build -endif - -MODULE_ARGS= -ifdef MODULES - MODULE_ARGS = -l $(MODULES) -endif - -PLUGIN_ARGS= -ifdef PLUGINS - PLUGIN_ARGS = -l $(PLUGINS) -endif - -DOC_PLUGINS ?= cache callback connection inventory lookup shell strategy vars - -assertrst: -ifndef rst - $(error specify document or pattern with rst=somefile.rst) -endif - -all: docs - -docs: clean htmldocs - -generate_rst: staticmin - -htmldocs: generate_rst - python -m ansiblelint -L -f rst > rst/rules/default_rules.rst - CPUS=$(CPUS) $(MAKE) -f Makefile.sphinx html - @sh -c "git diff --quiet || { echo 'ERROR: Building docs changed tracked files, include them in commit to avoid this failure.'; exit 1; }" - -singlehtmldocs: generate_rst - CPUS=$(CPUS) $(MAKE) -f Makefile.sphinx singlehtml - -webdocs: docs - -#TODO: leaving htmlout removal for those having older versions, should eventually be removed also -clean: - @echo "Cleaning $(BUILDDIR)" - -rm -rf $(BUILDDIR)/doctrees - -rm -rf $(BUILDDIR)/html - -rm -rf htmlout - -rm -rf module_docs - -rm -rf _build - -rm -f .buildinfo - -rm -f objects.inv - -rm -rf *.doctrees - @echo "Cleaning up minified css files" - find . -type f -name "*.min.css" -delete - @echo "Cleaning up byte compiled python stuff" - find . -regex ".*\.py[co]$$" -delete - @echo "Cleaning up editor backup files" - find . -type f \( -name "*~" -or -name "#*" \) -delete - find . -type f \( -name "*.swp" \) -delete - @echo "Cleaning up generated rst" - -.PHONY: docs clean - -staticmin: - cat _themes/srtd/static/css/theme.css | sed -e 's/^[ ]*//g; s/[ ]*$$//g; s/\([:{;,]\) /\1/g; s/ {/{/g; s/\/\*.*\*\///g; /^$$/d' | sed -e :a -e '$$!N; s/\n\(.\)/\1/; ta' > _themes/srtd/static/css/theme.min.css - -epub: - (CPUS=$(CPUS) $(MAKE) -f Makefile.sphinx epub) - -htmlsingle: assertrst - sphinx-build -j $(CPUS) -b html -d $(BUILDDIR)/doctrees ./rst $(BUILDDIR)/html rst/$(rst) - @echo "Output is in $(BUILDDIR)/html/$(rst:.rst=.html)" diff --git a/docs/docsite/Makefile.sphinx b/docs/docsite/Makefile.sphinx deleted file mode 100644 index 9c578b4e328..00000000000 --- a/docs/docsite/Makefile.sphinx +++ /dev/null @@ -1,25 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -j $(CPUS) -n -w rst_warnings -SPHINXBUILD = sphinx-build -SPHINXPROJ = sdfsdf -SOURCEDIR = rst - -# Sets the build output directory if it's not specified on the command line -ifndef BUILDDIR - BUILDDIR = _build -endif - -# Put it first so that "make" without argument is like "make help". -help: - $(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile.sphinx - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile.sphinx - $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - @echo "BUILD: Produced docs at file://$(realpath $(BUILDDIR))/html/index.html" diff --git a/tox.ini b/tox.ini index ba652cd5711..b8e7763785a 100644 --- a/tox.ini +++ b/tox.ini @@ -103,9 +103,24 @@ passenv = PRE_COMMIT_HOME [testenv:docs] -whitelist_externals = make +basepython = python3 deps = sphinx -commands = make -C docs/docsite htmldocs +commands = +# sh -c "cat _themes/srtd/static/css/theme.css | sed -e 's/^[ ]*//g; s/[ ]*$//g; s/\([:{;,]\) /\1/g; s/ {/{/g; s/\/\*.*\*\///g; /^$/d' | sed -e :a -e '$!N; s/\n\(.\)/\1/; ta' > _themes/srtd/static/css/theme.min.css" + sh -c "{envpython} -m ansiblelint -L -f rst > rst/rules/default_rules.rst" +# -W \ # TODO: apply once no warnings + {envpython} -m sphinx \ + -j auto \ + --color \ + -n \ + -b html \ + rst/ \ + _build/html/ + {envpython} -c 'print("BUILD: Produced docs at file://{toxinidir}/docs/docsite/_build/html/index.html")' + sh -c "git diff --quiet || \{ echo 'ERROR: Building docs changed tracked files, include them in commit to avoid this failure.'; exit 1; \}" +changedir = {toxinidir}/docs/docsite +whitelist_externals = + sh [testenv:metadata-validation] description =