Makefile 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. all: asciidoc2html asciidoc2docbook dokk.json
  2. # Convert articles to DOCBOOK
  3. asciidoc2docbook : $(subst :,\:,$(shell find ./articles -type f -name "*.adoc" | sed -E 's/^.*\/(.*)\.adoc$$/docbook\/\1.dbk/'))
  4. docbook/%.dbk : articles/%.adoc
  5. @ADOC="$<"
  6. @DBK="$@"
  7. @echo "$$ADOC -> $$DBK"
  8. # Check "./docbook" exists
  9. mkdir --parents docbook
  10. # Convert ASCIIDOC to DOCBOOK
  11. @asciidoc --backend docbook --doctype book --out-file "$$DBK" "$$ADOC"
  12. # Convert articles to HTML
  13. asciidoc2html : $(subst :,\:,$(shell find ./articles -type f -name "*.adoc" | sed -E 's/^.*\/(.*)\.adoc$$/html\/\1.html/'))
  14. html/%.html : articles/%.adoc
  15. @ADOC="$<"
  16. @HTML="$@"
  17. @echo "$$ADOC -> $$HTML"
  18. # Check "./html" exists
  19. mkdir --parents html
  20. # Convert ASCIIDOC to HTML
  21. @asciidoc --backend html5 --doctype book --no-header-footer \
  22. --out-file "$$HTML" "$$ADOC"
  23. # Find which nodes link to which. Used for dokk.org/explore
  24. dokk.json: dokk.ttl
  25. ./relations.py
  26. clean:
  27. rm --force --recursive docbook html
  28. .ONESHELL:
  29. .SUFFIXES:
  30. .PHONY:
  31. .DELETE_ON_ERROR: