From db4036f441ddc8b52454f163cfb81c41b54e7eaa Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 8 Apr 2021 19:12:11 +0100 Subject: [PATCH] docs: Wire build into our top-level Makefile Signed-off-by: Ian Jackson --- Makefile | 11 ++++++++++- docs/Makefile | 20 -------------------- docs/dev.md | 3 ++- 3 files changed, 12 insertions(+), 22 deletions(-) delete mode 100644 docs/Makefile diff --git a/Makefile b/Makefile index a671eee5..7d47638a 100644 --- a/Makefile +++ b/Makefile @@ -51,6 +51,8 @@ WASM_BINDGEN_OPTIONS = \ BUNDLE_SOURCES ?= bundle-rust-sources +SPHINXBUILD = sphinx-build + ifndef INKSCAPE_EXTENSIONS INKSCAPE ?= inkscape INKSCAPE_EXTENSIONS := $(shell $(INKSCAPE) -x) @@ -138,7 +140,7 @@ WASM := wasm32-unknown-unknown check: stamp/cargo.check at wdt @echo 'All tests passed.' -doc: cargo-doc +doc: cargo-doc sphinx-doc debug release:: %: stamp/cargo.% assets libraries extra-% @@ -214,6 +216,13 @@ stamp/cargo.deploy-build: $(call rsrcs,.) $(CARGO) -T$(DEPLOY_ARCH) build $(call cr,$(DEPLOY_RELEASE)) -p otter -p otter-daemon $(stamp) +#---------- sphnix ---------- + +sphinx-doc: docs/html/index.html + +docs/build/html/index.html: docs/conf.py $(wildcard docs/*.md docs/*.rst) + $(SPHINXBUILD) -M html docs docs/build $(SPHINXOPTS) + #---------- wasm ---------- $(addprefix $(WASM_PACKED)/,$(WASM_ASSETS) $(WASM_OUTPUTS)): stamp/wasm-bindgen diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index 35e7246e..00000000 --- a/docs/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -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 - -# 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/docs/dev.md b/docs/dev.md index a8f823af..6f997446 100644 --- a/docs/dev.md +++ b/docs/dev.md @@ -22,7 +22,8 @@ Setup sudo apt install build-essential cpio git curl \ pkg-config libssl-dev \ node-typescript inkscape bubblewrap \ - netpbm imagemagick + netpbm imagemagick \ + python3-sphinx python3-recommonmark ``` 2. Install Rust. This is most easily done with [rustup](https://rustup.rs)): -- 2.30.2