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