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