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