From 9381a309b94381c620b9f7ff77a88776958a1ebb Mon Sep 17 00:00:00 2001 From: Dimitri Merejkowsky Date: Wed, 12 Feb 2020 11:47:01 +0100 Subject: [PATCH] Replace Makefile with a simple script --- cours/Makefile | 20 -------------------- cours/build.py | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 20 deletions(-) delete mode 100644 cours/Makefile create mode 100755 cours/build.py diff --git a/cours/Makefile b/cours/Makefile deleted file mode 100644 index d0c3cbf..0000000 --- a/cours/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build -SOURCEDIR = source -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 - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/cours/build.py b/cours/build.py new file mode 100755 index 0000000..91853aa --- /dev/null +++ b/cours/build.py @@ -0,0 +1,16 @@ +import sys +import subprocess + + +def main(): + dev = "--dev" in sys.argv + if dev: + program = "sphinx-autobuild" + else: + program = "sphinx-build" + cmd = [program, "-d", "build", "-b", "html", "source", "build/html"] + subprocess.run(cmd, check=True) + + +if __name__ == "__main__": + main()