Skip to content

Commit a49a1fd

Browse files
committed
Documentation: Nix uses make to build documentation
1 parent 5de9a01 commit a49a1fd

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

.readthedocs.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
version: 2
22

33
sphinx:
4+
builder: "html"
45
configuration: docs/conf.py
56

67
build:

docs/Makefile

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Minimal makefile for Sphinx documentation
2-
#
32

43
# You can set these variables from the command line, and also
54
# from the environment for the first two.
@@ -8,13 +7,7 @@ SPHINXBUILD ?= sphinx-build
87
SOURCEDIR = .
98
BUILDDIR = _build
109

11-
# Put it first so that "make" without argument is like "make help".
12-
help:
13-
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
10+
.PHONY: Makefile
1411

15-
.PHONY: help Makefile
16-
17-
# Catch-all target: route all unknown targets to Sphinx using the new
18-
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19-
%: Makefile
20-
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
12+
html: Makefile
13+
@$(SPHINXBUILD) -n -W "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

flake.nix

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@
2727
name = "hls-docs";
2828
src = pkgs.lib.sourceFilesBySuffices ./. [ ".py" ".rst" ".md" ".png" ".gif" ".svg" ".cabal" ];
2929
buildInputs = [ pythonWithPackages ];
30-
# -n gives warnings on missing link targets, -W makes warnings into errors
31-
buildPhase = ''cd docs; sphinx-build -n -W . $out'';
30+
buildPhase = ''
31+
cd docs
32+
make --makefile=${./docs/Makefile} html BUILDDIR=$out
33+
'';
3234
dontInstall = true;
3335
};
3436

0 commit comments

Comments
 (0)