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