summaryrefslogtreecommitdiff
path: root/Makefile
blob: eceebac6a9691261ba44f62e2f3a8056f4de6782 (plain)
  1. SSH_HOST = www-ruc@xayide.jones.dk
  2. SSH_BASE_PATH = public_websites/thoughtroam.abcde.../
  3. BASE_SSH = $(SSH_HOST):$(SSH_BASE_PATH)
  4. BASE_IRI = https://thoughtroam.abcdefghijklmnopqrstuvxyzæøå.dk/
  5. PAD_ARTICLES = worlding
  6. ARTICLES = waste worlding
  7. ONTOLOGIES = learn waste
  8. GRAPHS = $(patsubst ex/%.ttl,%,$(wildcard ex/*.ttl))
  9. PERL_FILES = bin/biblatex-tidy bin/hedgedoc2quarto bin/xmp2rdfxml
  10. TIDY_MARKDOWN = worlding
  11. export HEDGEDOC_COOKIES_FILE = $(CURDIR)/cookies.txt
  12. export HEDGEDOC_SERVER = https://pad.degrowth.net/
  13. all: preview
  14. preview:
  15. quarto preview
  16. render:
  17. quarto render
  18. publish:
  19. rsync -avH --delete-after _site/ $(BASE_SSH)
  20. prepare: learn/core.ttl learn/tentacular.ttl
  21. cal-all: cal-fetch cal-render cal-publish
  22. cal-fetch:
  23. bin/cal-fetch.sh
  24. cal-render:
  25. bin/cal-publish.sh
  26. cal-publish:
  27. ssh $(SSH_HOST) mkdir -p $(SSH_BASE_PATH)events/
  28. rsync -avH --delete-after $(patsubst %,events/%,$(ARTICLES) superteam) $(BASE_SSH)events/
  29. pad-login:
  30. hedgedoc login --email
  31. pad-list:
  32. hedgedoc history
  33. pad-export-all: $(PAD_ARTICLES:%=pad-export-%)
  34. pad-export-worlding: ref.bib worlding/index.qmd \
  35. $(patsubst %,worlding/_%.qmd,baggrund teori_og_metode undersøgelser konklusion perspektivering kilder planer)
  36. ref.bib:
  37. hedgedoc export --md 8krqOrqnR0iAIExDTtTrxw $@
  38. perl -g -e 's/\s*\z/\n/' $@
  39. worlding/index.qmd:
  40. hedgedoc export --md MJei_2e-SjahCtmRT-xiPw $@
  41. perl -g -e 's/\s*\z/\n/' $@
  42. worlding/_baggrund.qmd:
  43. hedgedoc export --md mGHhKvXyQ5SVeTIU11isQQ $@
  44. perl -g -e 's/\s*\z/\n/' $@
  45. worlding/_teori_og_metode.qmd:
  46. hedgedoc export --md 5AbKoR-mTOij6TsCMFFDRw $@
  47. perl -g -e 's/\s*\z/\n/' $@
  48. worlding/_undersøgelser.qmd:
  49. hedgedoc export --md 5XR69V5rSEm9LwsLNtSXcQ $@
  50. perl -g -e 's/\s*\z/\n/' $@
  51. worlding/_konklusion.qmd:
  52. hedgedoc export --md ofRbx2f4QcWLR-o_kqTNCQ $@
  53. perl -g -e 's/\s*\z/\n/' $@
  54. worlding/_perspektivering.qmd:
  55. hedgedoc export --md lU8aUxCkR5GNrP-8frklFA $@
  56. perl -g -e 's/\s*\z/\n/' $@
  57. worlding/_kilder.qmd:
  58. hedgedoc export --md Jt6S4tAhQM-BUrAP-OllCg $@
  59. perl -g -e 's/\s*\z/\n/' $@
  60. worlding/_planer.qmd:
  61. hedgedoc export --md qfFl3xiaQWCbpoyNPbNsEA $@~
  62. bin/hedgedoc2quarto $@~ $@
  63. $(PAD_ARTICLES:%=pad-import-%): pad-import-%:
  64. hedgedoc import $*/index.qmd
  65. pad-import-ref:
  66. hedgedoc import ref.bib
  67. lint: lint-markdown
  68. lint-markdown:
  69. @mdl --ignore-front-matter --style .mdl.rb $(filter-out %/index.qmd,$(wildcard $(addsuffix /*.qmd,$(TIDY_MARKDOWN))))
  70. tidy: tidy-bibtex tidy-perl
  71. tidy-bibtex: ref.bib
  72. bin/biblatex-tidy $<
  73. tidy-perl:
  74. perltidy -b -bext='/' --profile=.perltidyrc $(PERL_FILES)
  75. $(ARTICLES:%=screening-of-%): screening-of-%:
  76. QUARTO_LOG_LEVEL=quiet \
  77. quarto render $*/index.qmd --to man --output - | man -l -
  78. $(ARTICLES:%=wordcount-of-%): wordcount-of-%:
  79. QUARTO_LOG_LEVEL=quiet \
  80. quarto render $*/index.qmd --to plain --columns=9999 --output - \
  81. | perl -nE 'next if /^-*$$/; $$bilag += $$_ =~ "^Bilag\\b"; $$chars += length unless $$bilag; END { say $$chars }'
  82. $(ARTICLES:%=turtle-from-%): turtle-from-%:
  83. @bin/xmp2rdfxml _site/$*/S*.pdf \
  84. | rapper -i rdfxml -o turtle - $(BASE_IRI)$*/
  85. $(ARTICLES:%=dotgraph-from-%): dotgraph-from-%:
  86. @bin/xmp2rdfxml _site/$*/S*.pdf \
  87. | rapper -i rdfxml -o dot - $(BASE_IRI)$*/
  88. diff-all: $(ARTICLES:%=diff-of-%)
  89. $(ARTICLES:%=diff-of-%): diff-of-%: %/changes.tex
  90. $(ARTICLES:%=%/changes.tex): %/changes.tex: %/a.tex %/b.tex
  91. latexdiff --type CULINECHBAR --subtype COLOR --replace-context2cmd '' $^ > $*/changes.tex
  92. perl -i -pe 's/\[pdftex\]{changebar}/[luatex]{changebar}/g' $*/changes.tex
  93. latexmk --gg --lualatex --cd --silent --Werror $*/changes.tex
  94. find $*/ -name 'changes.*' -not -name changes.pdf -delete
  95. rm -f $^
  96. $(ARTICLES:%=%/a.tex): %/a.tex:
  97. git switch --detach $(shell git describe --tags --abbrev=0)
  98. QUARTO_LOG_LEVEL=quiet \
  99. quarto render $*/index.qmd --to pdf -M keep-tex:true --output a.pdf
  100. mv --force $*/index.tex $@
  101. rm --force _site/a.pdf
  102. $(ARTICLES:%=%/b.tex): %/b.tex:
  103. git switch -
  104. QUARTO_LOG_LEVEL=quiet \
  105. quarto render $*/index.qmd --to pdf -M keep-tex:true --output b.pdf
  106. mv --force $*/index.tex $@
  107. rm --force _site/b.pdf
  108. %/concepts.svg: %/core.sdm
  109. sdml draw --diagram concepts -i $< -f svg -o $@
  110. %/er.svg: %/core.sdm
  111. sdml draw --diagram entity-relationship -i $< -f svg -o $@
  112. %/uml.svg: %/core.sdm
  113. sdml draw --diagram uml-class -i $< -f svg -o $@
  114. %.ttl: %.sdm
  115. sdml convert -i $< -f rdf -o $@ --no-color
  116. %/core.puml: %/core.ttl %/prefixes.ttl
  117. rdfpuml $<
  118. %/core.png: %/core.puml
  119. plantuml -tpng $<
  120. %/core.svg: %/core.puml
  121. plantuml -tsvg $<
  122. ex/%.puml: ex/%.ttl ex/prefixes.ttl
  123. rdfpuml $<
  124. ex/%.png: ex/%.puml
  125. plantuml -tpng $<
  126. ex/%.svg: ex/%.puml
  127. plantuml -tsvg $<
  128. %/docs/index.html: %/core.ttl
  129. mkdir --parents $*/docs
  130. ontospy gendocs --type 2 -x -o $(CURDIR)/$*/docs $<
  131. $(ONTOLOGIES:%=view-%-concept-diagram): view-%-concept-diagram: %/concepts.svg
  132. inkview $<
  133. $(ONTOLOGIES:%=view-%-er-diagram): view-%-er-diagram: %/er.svg
  134. inkview $<
  135. $(ONTOLOGIES:%=view-%-uml-diagram): view-%-uml-diagram: %/uml.svg
  136. inkview $<
  137. $(ONTOLOGIES:%=view-%-rdfs-graf): view-%-rdfs-graf: %/core.ttl
  138. rdfs2dot -f turtle $< | xdot -
  139. view-learn_tentacular-rdfs-graf: learn/tentacular.ttl
  140. rdfs2dot -f turtle $< | xdot -
  141. view-learn_all-rdfs-graf: learn/core.ttl learn/tentacular.ttl
  142. rdfs2dot -f turtle $^ | xdot -
  143. #$(ONTOLOGIES:%=view-%-puml-diagram): view-%-puml-diagram: %/core.svg
  144. # inkview $<
  145. $(ONTOLOGIES:%=view-%-puml-diagram): view-%-puml-diagram: %/core.png
  146. imv-wayland $<
  147. $(GRAPHS:%=view-%-puml-diagram): view-%-puml-diagram: ex/%.png
  148. imv-wayland $<
  149. $(ONTOLOGIES:%=render-%-ontology): render-%-ontology: %/docs/index.html