aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: eb73d9640e19842ff35096abdc0ccafacd339f0c (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 = waste worlding
  6. ARTICLES = waste worlding
  7. ONTOLOGIES = learning waste
  8. PERL_FILES = 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 waste/index.qmd
  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. waste/index.qmd:
  39. hedgedoc export --md EXC6tW48SYu0_s_MA6cORw $@~
  40. bin/hedgedoc2quarto $@~ $@
  41. worlding/index.qmd:
  42. hedgedoc export --md MJei_2e-SjahCtmRT-xiPw $@
  43. perl -g -e 's/\s*\z/\n/' $@
  44. worlding/_baggrund.qmd:
  45. hedgedoc export --md mGHhKvXyQ5SVeTIU11isQQ $@
  46. perl -g -e 's/\s*\z/\n/' $@
  47. worlding/_teori_og_metode.qmd:
  48. hedgedoc export --md 5AbKoR-mTOij6TsCMFFDRw $@
  49. perl -g -e 's/\s*\z/\n/' $@
  50. worlding/_undersøgelser.qmd:
  51. hedgedoc export --md 5XR69V5rSEm9LwsLNtSXcQ $@
  52. perl -g -e 's/\s*\z/\n/' $@
  53. worlding/_konklusion.qmd:
  54. hedgedoc export --md ofRbx2f4QcWLR-o_kqTNCQ $@
  55. perl -g -e 's/\s*\z/\n/' $@
  56. worlding/_perspektivering.qmd:
  57. hedgedoc export --md lU8aUxCkR5GNrP-8frklFA $@
  58. perl -g -e 's/\s*\z/\n/' $@
  59. worlding/_kilder.qmd:
  60. hedgedoc export --md Jt6S4tAhQM-BUrAP-OllCg $@
  61. perl -g -e 's/\s*\z/\n/' $@
  62. worlding/_planer.qmd:
  63. hedgedoc export --md qfFl3xiaQWCbpoyNPbNsEA $@~
  64. bin/hedgedoc2quarto $@~ $@
  65. $(PAD_ARTICLES:%=pad-import-%): pad-import-%:
  66. hedgedoc import $*/index.qmd
  67. pad-import-ref:
  68. hedgedoc import ref.bib
  69. lint: lint-markdown
  70. lint-markdown:
  71. @mdl --ignore-front-matter --style .mdl.rb $(filter-out %/index.qmd,$(wildcard $(addsuffix /*.qmd,$(TIDY_MARKDOWN))))
  72. tidy: tidy-bibtex tidy-perl
  73. tidy-bibtex:
  74. bibclean -max-width 0 ref.bib > ref.bib~
  75. mv ref.bib~ ref.bib
  76. tidy-perl:
  77. perltidy -b -bext='/' --profile=.perltidyrc $(PERL_FILES)
  78. $(ARTICLES:%=screening-of-%): screening-of-%:
  79. QUARTO_LOG_LEVEL=quiet \
  80. quarto render $*/index.qmd --to man --output - | man -l -
  81. $(ARTICLES:%=wordcount-of-%): wordcount-of-%:
  82. QUARTO_LOG_LEVEL=quiet \
  83. quarto render $*/index.qmd --to plain --columns=9999 --output - \
  84. | perl -nE 'next if /^-*$$/; $$bilag += $$_ =~ "^Bilag 1\\b"; $$chars += length unless $$bilag; END { say $$chars }'
  85. $(ARTICLES:%=turtle-from-%): turtle-from-%:
  86. @bin/xmp2rdfxml _site/$*/S*.pdf \
  87. | rapper -i rdfxml -o turtle - $(BASE_IRI)$*/
  88. $(ARTICLES:%=dotgraph-from-%): dotgraph-from-%:
  89. @bin/xmp2rdfxml _site/$*/S*.pdf \
  90. | rapper -i rdfxml -o dot - $(BASE_IRI)$*/
  91. diff-all: $(ARTICLES:%=diff-of-%)
  92. $(ARTICLES:%=diff-of-%): diff-of-%: %/changes.tex
  93. $(ARTICLES:%=%/changes.tex): %/changes.tex: %/a.tex %/b.tex
  94. latexdiff --type CULINECHBAR --subtype COLOR --replace-context2cmd '' $^ > $*/changes.tex
  95. perl -i -pe 's/\[pdftex\]{changebar}/[luatex]{changebar}/g' $*/changes.tex
  96. latexmk --gg --lualatex --cd --silent --Werror $*/changes.tex
  97. find $*/ -name 'changes.*' -not -name changes.pdf -delete
  98. rm -f $^
  99. $(ARTICLES:%=%/a.tex): %/a.tex:
  100. git switch --detach $(shell git describe --tags --abbrev=0)
  101. QUARTO_LOG_LEVEL=quiet \
  102. quarto render $*/index.qmd --to pdf -M keep-tex:true --output a.pdf
  103. mv --force $*/index.tex $@
  104. rm --force _site/a.pdf
  105. $(ARTICLES:%=%/b.tex): %/b.tex:
  106. git switch -
  107. QUARTO_LOG_LEVEL=quiet \
  108. quarto render $*/index.qmd --to pdf -M keep-tex:true --output b.pdf
  109. mv --force $*/index.tex $@
  110. rm --force _site/b.pdf
  111. rdf/%.svg: rdf/%.sdm
  112. sdml draw --diagram concepts -i $< -f svg -o $@
  113. rdf/%-er.svg: rdf/%.sdm
  114. sdml draw --diagram entity-relationship -i $< -f svg -o $@
  115. rdf/%-uml.svg: rdf/%.sdm
  116. sdml draw --diagram uml-class -i $< -f svg -o $@
  117. rdf/%.ttl: rdf/%.sdm
  118. sdml convert -i $< -f rdf -o $@ --no-color
  119. rdf/%/index.html: rdf/%.ttl
  120. mkdir --parents rdf/$*
  121. ontospy gendocs --type 2 -x -o $(CURDIR)/rdf/$* $<
  122. $(ONTOLOGIES:%=view-%-concept-diagram): view-%-concept-diagram: rdf/%.svg
  123. inkview $<
  124. $(ONTOLOGIES:%=view-%-er-diagram): view-%-er-diagram: rdf/%-er.svg
  125. inkview $<
  126. $(ONTOLOGIES:%=view-%-uml-diagram): view-%-uml-diagram: rdf/%-uml.svg
  127. inkview $<
  128. $(ONTOLOGIES:%=view-%-rdfs-graf): view-%-rdfs-graf: rdf/%.ttl
  129. rdfs2dot -f turtle $< | xdot -
  130. $(ONTOLOGIES:%=render-%-ontology): render-%-ontology: rdf/%/index.html