add option to build in light mode
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
LordMZTE 2021-04-15 17:54:46 +02:00
parent a2fd169fea
commit 1a9e1b0a01
3 changed files with 33 additions and 10 deletions

View file

@ -1,11 +1,23 @@
BASE_ATTRS=\
DARK_BASE_ATTRS=\
color=white \
fontcolor=white \
fontcolor=white
DARK_GRAPH_ATTRS=\
$(DARK_BASE_ATTRS) \
bgcolor=gray8
DARK_NODE_ATTRS=\
$(DARK_BASE_ATTRS)
DARK_EDGE_ATTRS=\
$(DARK_BASE_ATTRS)
BASE_ATTRS=\
fontname="sans-serif"
GRAPH_ATTRS=\
$(BASE_ATTRS) \
bgcolor=gray8
NODE_ATTRS=\
$(BASE_ATTRS)
@ -18,18 +30,31 @@ DOT_BASE_CMD=dot \
$(patsubst %,-N%,$(NODE_ATTRS)) \
$(patsubst %,-E%,$(EDGE_ATTRS))
DARK_CMD_EXT=\
$(patsubst %,-G%,$(DARK_GRAPH_ATTRS)) \
$(patsubst %,-N%,$(DARK_NODE_ATTRS)) \
$(patsubst %,-E%,$(DARK_EDGE_ATTRS))
DOT_CMD=$(shell if [[ -v "LIGHT_MODE" ]]; then echo "$(DOT_BASE_CMD)"; else echo "$(DOT_BASE_CMD) $(DARK_CMD_EXT)"; fi)
BUILD_PATH_PREFIX=$(shell if [[ -v "LIGHT_MODE" ]]; then echo "light/"; fi)
.PHONY: All
All: build/de.png build/de.svg build/en.png build/en.svg
All:\
$(BUILD_PATH_PREFIX)build/de.png \
$(BUILD_PATH_PREFIX)build/de.svg \
$(BUILD_PATH_PREFIX)build/en.png \
$(BUILD_PATH_PREFIX)build/en.svg
.PHONY: clean
clean:
rm -rf build
build/%.svg: %.dot
$(BUILD_PATH_PREFIX)build/%.svg: %.dot
@mkdir -p $(@D)
$(DOT_BASE_CMD) -Tsvg $< -o $@
$(DOT_CMD) -Tsvg $< -o $@
build/%.png: %.dot
$(BUILD_PATH_PREFIX)build/%.png: %.dot
@mkdir -p $(@D)
$(DOT_BASE_CMD) -Tpng $< -o $@
$(DOT_CMD) -Tpng $< -o $@

1
de.dot
View file

@ -19,7 +19,6 @@ digraph langchart {
subgraph cluster0 {
label="Embedded Scripting";
color=white;
n_4 [label="Wird die Sprache in einem sehr komplexem Programm wie einem Browser als Scriptsprache verwendet?"];

1
en.dot
View file

@ -19,7 +19,6 @@ digraph langchart {
subgraph cluster0 {
label="Embedded Scripting";
color=white;
n_4 [label="Is the language used for scripting in a very complex program such as a browser?"];