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