summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2017-08-23 17:48:42 +0200
committerJonas Smedegaard <dr@jones.dk>2017-08-23 17:48:42 +0200
commit93687d6c73e0f0d367bdbfe9989d4368e8e699bd (patch)
treebfbfd3fdba63ff194b5669c8af919870021b698d
parent057985f00074f9a6a97e48acb5350a23291c6dd0 (diff)
Generate SVG graphs.
-rw-r--r--Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 3dad6aa..7ac3afc 100644
--- a/Makefile
+++ b/Makefile
@@ -2,8 +2,10 @@ markdown-snippets := topbar.mdwn footer.mdwn
hypertext-snippets = $(markdown-snippets:%.mdwn=%.html)
markdown := $(filter-out $(markdown-snippets),$(wildcard *.mdwn */*.mdwn */*/*.mdwn))
hypertext = $(subst index/index,index,$(markdown:%.mdwn=%/index.html))
+graph := $(wildcard *.dot */*.dot */*/*.dot)
+vectorimage-graph := $(graph:%.dot=%.svg)
-all: $(hypertext) style.css
+all: $(hypertext) $(vectorimage-graph) style.css
update: .git
git pull
@@ -13,6 +15,9 @@ $(hypertext-snippets): %.html: %.mdwn Makefile
pandoc -f markdown -t html -o $@ $<
sed -i -e '1i <div class=\"$*\">' -e '$$ a </div>' $@
+$(vectorimage-graph): %.svg: %.dot Makefile
+ dot -Tsvg -o$@ $<
+
%.html %/index.html: %.mdwn $(hypertext-snippets) Makefile
$(if $(filter-out ./,$(dir $@)),mkdir -p $(dir $@))
pandoc -s -c /style.css -B topbar.html -A footer.html -f markdown -t html -o $@ $<
@@ -21,6 +26,7 @@ $(hypertext-snippets): %.html: %.mdwn Makefile
scss --compass --style compressed $< $@
clean:
+ rm -f $(vectorimage-graph)
find -type f -name '*.html' -delete
find -type d -empty -delete
rm -f style.css style.css.map