From 0381bc170c681b6ea8a94467c62e0694e3d9029d Mon Sep 17 00:00:00 2001 From: Adrian Likins Date: Fri, 13 Jan 2017 14:32:27 -0500 Subject: [PATCH] Docsite sphinx rm buildsite (and speed up docs build) (#20237) Replace docs build-site.py with default-ish sphinx build This seems to speed up docsite build _alot_. The Makefile.sphinx is the sphinx-quickstart generated makefile with a few changes. The CPUS env var or 'nproc' output is used for the number of cpus passed to 'sphinx-build -j' --- docs/docsite/Makefile | 13 +++++-------- docs/docsite/Makefile.sphinx | 20 ++++++++++++++++++++ docs/docsite/build.sh | 7 +++++++ 3 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 docs/docsite/Makefile.sphinx create mode 100755 docs/docsite/build.sh diff --git a/docs/docsite/Makefile b/docs/docsite/Makefile index 2669b9e474..7978d69719 100644 --- a/docs/docsite/Makefile +++ b/docs/docsite/Makefile @@ -1,12 +1,11 @@ SITELIB = $(shell python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()") FORMATTER=../../hacking/module_formatter.py DUMPER=../../hacking/dump_playbook_attributes.py -CPUS ?= 1 +CPUS := $(shell nproc) all: clean docs -docs: clean directives modules staticmin - ./build-site.py -j $(CPUS) +docs: clean directives modules htmldocs -(cp *.ico htmlout/) -(cp *.jpg htmlout/) -(cp *.png htmlout/) @@ -15,16 +14,14 @@ variables: (mkdir -p htmlout/) dot variables.dot -Tpng -o htmlout/variables.png -viewdocs: clean staticmin - ./build-site.py -j $(CPUS) view - -htmldocs: staticmin - ./build-site.py -j $(CPUS) rst +htmldocs: directives modules staticmin + CPUS=$(CPUS) $(MAKE) -f Makefile.sphinx html webdocs: htmldocs clean: -rm -rf htmlout + -rm -rf _build -rm -f .buildinfo -rm -f *.inv -rm -rf *.doctrees diff --git a/docs/docsite/Makefile.sphinx b/docs/docsite/Makefile.sphinx new file mode 100644 index 0000000000..cddb40a8f4 --- /dev/null +++ b/docs/docsite/Makefile.sphinx @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = -j $(CPUS) +SPHINXBUILD = sphinx-build +SPHINXPROJ = sdfsdf +SOURCEDIR = . +BUILDDIR = _build + +# 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) diff --git a/docs/docsite/build.sh b/docs/docsite/build.sh new file mode 100755 index 0000000000..968e9e25b8 --- /dev/null +++ b/docs/docsite/build.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +make -f Makefile.old clean +make -f Makefile.old modules +make -f Makefile.old directives + +time make html