aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 0fa7b0313644c359c7997097f124d59396f158d1 (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/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:
  70. bibclean -max-width 0 ref.bib > ref.bib~
  71. mv ref.bib~ ref.bib
  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 1\\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/%.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/%/index.html: rdf/%.ttl
  116. mkdir --parents rdf/$*
  117. ontospy gendocs --type 2 -x -o $(CURDIR)/rdf/$* $<
  118. $(ONTOLOGIES:%=view-%-concept-diagram): view-%-concept-diagram: rdf/%.svg
  119. inkview $<
  120. $(ONTOLOGIES:%=view-%-er-diagram): view-%-er-diagram: rdf/%-er.svg
  121. inkview $<
  122. $(ONTOLOGIES:%=view-%-uml-diagram): view-%-uml-diagram: rdf/%-uml.svg
  123. inkview $<
  124. $(ONTOLOGIES:%=view-%-rdfs-graf): view-%-rdfs-graf: rdf/%.ttl
  125. rdfs2dot -f turtle $< | xdot -
  126. $(ONTOLOGIES:%=render-%-ontology): render-%-ontology: rdf/%/index.html