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