summaryrefslogtreecommitdiff
path: root/Makefile
blob: 63ceea842bad24e29501e86f16dc1d1155fa0271 (plain)
  1. markdown-snippets := topbar.mdwn footer.mdwn
  2. hypertext-snippets = $(markdown-snippets:%.mdwn=%.html)
  3. markdown := $(filter-out $(markdown-snippets),$(wildcard *.mdwn */*.mdwn */*/*.mdwn))
  4. hypertext = $(subst index/index,index,$(markdown:%.mdwn=%/index.html))
  5. graph := $(wildcard *.dot */*.dot */*/*.dot)
  6. vectorimage-graph := $(graph:%.dot=%.svg)
  7. compass_plugins = h5bp
  8. all: $(hypertext) $(vectorimage-graph) style.css
  9. update: .git
  10. git pull
  11. $(MAKE) all
  12. $(hypertext-snippets): %.html: %.mdwn Makefile
  13. pandoc -f commonmark -t html -o $@ $<
  14. sed -i -e '1i <div class=\"$*\">' -e '$$ a </div>' $@
  15. $(vectorimage-graph): %.svg: %.dot Makefile
  16. dot -Tsvg -o$@ $<
  17. %.html %/index.html: %.mdwn $(hypertext-snippets) Makefile
  18. $(if $(filter-out ./,$(dir $@)),mkdir -p $(dir $@))
  19. pandoc -s -c $(shell realpath --relative-to=$(dir $@) style.css) -B topbar.html -A footer.html -f commonmark -t html -o $@ $<
  20. %.css : %.scss Makefile
  21. # scss --compass --style compressed $< $@
  22. sassc --load-path /usr/share/sass/stylesheets $(compass_plugins:%=--load-path /usr/share/compass/frameworks/%/stylesheets) --style compressed $< $@
  23. clean:
  24. rm -f $(vectorimage-graph)
  25. find -type f -name '*.html' -delete
  26. find -type d -empty -delete
  27. rm -f style.css style.css.map
  28. rm -rf .sass-cache
  29. MAKEFLAGS += --jobs
  30. .NOTPARALLEL: source
  31. .PHONY: all update clean