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