-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMakefile
42 lines (36 loc) · 1.54 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first three.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
BUILDDIR ?= build
SOURCEDIR = src
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help help-docker 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)
# Generating --ignore options from .gitignore means that src/fetch-docs.py,
# which runs on build and produces files in src/, doesn't trigger an endless
# loop of autobuilds. The syntax of .gitignore patterns is not actually
# identical to sphinx-autobuild's --ignore patterns (which use Python's
# fnmatch(), where "*" means something other than a normal glob, for example),
# but our usage is limited enough for this to work as much as necessary.
livehtml:
sphinx-autobuild -b html $(patsubst %,--ignore "**%",$(file < .gitignore)) "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.ONESHELL:
docker-html:
set -euox
docker build -t nextstrain-docs-builder --network=host .
docker run -it --rm \
--name=nextstrain-docs-builder-$(shell date +%s) \
--init \
--user=$(shell id -u):$(shell id -g) \
--volume=$(shell pwd):/home/user/src \
--workdir=/home/user/src \
--env 'TERM=xterm-256colors' \
nextstrain-docs-builder