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