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