config: separate make target for diagrams

Separate the build step and commit the output to the repository. This way the docs can be built on platforms that do not have inkscape, such as readthedocs.

pipenv run make -C doc diagrams
pipenv run make -C doc html
This commit is contained in:
Laurens Valk
2020-03-04 11:49:21 +01:00
parent 8861be68eb
commit 3c317967af
4 changed files with 7 additions and 5 deletions
+4 -1
View File
@@ -14,8 +14,11 @@ help:
.PHONY: help Makefile
diagrams:
@$(MAKE) -C "$(SOURCEDIR)"/diagram_source clean
@$(MAKE) -C "$(SOURCEDIR)"/diagram_source
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(MAKE) -C "$(SOURCEDIR)"/diagram_source `[ "$@" = "clean" ] && echo clean || echo all`
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+3 -3
View File
@@ -4,13 +4,13 @@ OUT_DIR = ../images
POSTFIX := _label
SVG := $(wildcard $(SRC_DIR)/*.svg)
PNG := $(patsubst $(SRC_DIR)/%.svg,$(OUT_DIR)/%$(POSTFIX).png,$(SVG))
DIAGRAMS := $(patsubst $(SRC_DIR)/%.svg,$(OUT_DIR)/%$(POSTFIX).png,$(SVG))
DIR := ${CURDIR}
all: $(PNG)
all: $(DIAGRAMS)
clean:
rm -f $(PNG)
rm -f $(DIAGRAMS)
$(OUT_DIR)/%$(POSTFIX).png: $(SRC_DIR)/%.svg
inkscape --file=$(DIR)/$< --export-area-drawing --export-png=$(DIR)/$@
-1
View File
@@ -1 +0,0 @@
*_label.png
Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB