mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-07-28 04:07:46 +00:00
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:
+4
-1
@@ -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)
|
||||
|
||||
@@ -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 +0,0 @@
|
||||
*_label.png
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 217 KiB |
Reference in New Issue
Block a user