From a1e743d656d7ac0d0ed9d6d9b7b02d614106f356 Mon Sep 17 00:00:00 2001 From: AA Turner <9087854+AA-Turner@users.noreply.github.com> Date: Wed, 9 Jun 2021 01:40:46 +0100 Subject: [PATCH 1/3] Add config option in `build.py` for Sphinx builders --- build.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/build.py b/build.py index f5e26a7dcac..a43209d7919 100644 --- a/build.py +++ b/build.py @@ -10,9 +10,11 @@ def create_parser(): parser = argparse.ArgumentParser(description="Build PEP documents") # alternative builders: parser.add_argument("-l", "--check-links", action="store_true") + parser.add_argument("-f", "--build-files", action="store_true") + parser.add_argument("-d", "--build-dirs", action="store_true") # flags / options - parser.add_argument("-f", "--fail-on-warning", action="store_true") + parser.add_argument("-w", "--fail-on-warning", action="store_true") parser.add_argument("-n", "--nitpicky", action="store_true") parser.add_argument("-j", "--jobs", type=int, default=1) @@ -31,9 +33,15 @@ def create_parser(): doctree_directory = build_directory / ".doctrees" # builder configuration - sphinx_builder = "dirhtml" - if args.check_links: + if args.build_files: + sphinx_builder = "html" + elif args.build_dirs: + sphinx_builder = "dirhtml" + elif args.check_links: sphinx_builder = "linkcheck" + else: + # default builder + sphinx_builder = "dirhtml" # other configuration config_overrides = {} From 6ae2ce0da1d18f407045a3d0d56cd4f759bcdc3b Mon Sep 17 00:00:00 2001 From: AA Turner <9087854+AA-Turner@users.noreply.github.com> Date: Wed, 9 Jun 2021 02:48:44 +0100 Subject: [PATCH 2/3] Add make target for building PEPs locally, without a web-server --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 930ff31a04a..91f08b186ca 100644 --- a/Makefile +++ b/Makefile @@ -66,6 +66,10 @@ pages: rss sphinx: $(SPHINX_BUILD) +# for building Sphinx without a web-server +sphinx-local: + $(SPHINX_BUILD) --build-files + fail_on_warning: $(SPHINX_BUILD) --fail-on-warning From 0b457432d01b70fdaa51df24083efca2b51f54f9 Mon Sep 17 00:00:00 2001 From: AA Turner <9087854+AA-Turner@users.noreply.github.com> Date: Wed, 9 Jun 2021 12:27:59 +0100 Subject: [PATCH 3/3] Update make targets to prefer hyphens --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 91f08b186ca..eebb2d613ef 100644 --- a/Makefile +++ b/Makefile @@ -70,8 +70,8 @@ sphinx: sphinx-local: $(SPHINX_BUILD) --build-files -fail_on_warning: +fail-warning: $(SPHINX_BUILD) --fail-on-warning -check_links: +check-links: $(SPHINX_BUILD) --check-links