aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 0b77820925f995d29e9bf191729dfe3f0a3d5199 (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. ARTICLES = learn code use
  6. export HEDGEDOC_COOKIES_FILE = $(CURDIR)/cookies.txt
  7. export HEDGEDOC_SERVER = https://pad.degrowth.net/
  8. all: preview
  9. preview:
  10. quarto preview
  11. render:
  12. quarto render
  13. publish:
  14. rsync -avH --delete-after _site/ $(BASE_SSH)
  15. cal-all: cal-fetch cal-render cal-publish
  16. cal-fetch:
  17. bin/cal-fetch.sh
  18. cal-render:
  19. bin/cal-publish.sh
  20. cal-publish:
  21. ssh $(SSH_HOST) mkdir -p $(SSH_BASE_PATH)events/
  22. rsync -avH --delete-after $(patsubst %,events/%,$(ARTICLES) superteam) $(BASE_SSH)events/
  23. pad-login:
  24. hedgedoc login --email
  25. pad-list:
  26. hedgedoc history
  27. pad-export-all: pad-export-superteam $(ARTICLES:%=pad-export-%) pad-export-code-gantt
  28. pad-export-superteam: ref.bib
  29. hedgedoc export --md 8krqOrqnR0iAIExDTtTrxw $<
  30. perl -g -e 's/\s*\z/\n/' $<
  31. pad-export-learn: learn/index.qmd
  32. hedgedoc export --md CP1pFdg_QlGiYxtKc9IHBg $<
  33. perl -g -e 's/\s*\z/\n/' $<
  34. pad-export-code: code/index.qmd
  35. hedgedoc export --md 8QGRP0iTRwe7hFmoAX4QnA $<
  36. perl -g -e 's/\s*\z/\n/' $<
  37. pad-export-code-gantt: code/_gantt.qmd
  38. hedgedoc export --md mJnfBHZ7Qr2W1Hu-QppL8A $<~
  39. bin/hedgedoc2quarto.sh < $<~ > $<
  40. rm -f $<~
  41. pad-export-use: use/index.qmd
  42. hedgedoc export --md aFt_nNkYTQibl0CQrBJhtQ $<
  43. perl -g -e 's/\s*\z/\n/' $<
  44. $(ARTICLES:%=pad-import-%): pad-import-%:
  45. hedgedoc import $*/index.qmd
  46. pad-import-ref:
  47. hedgedoc import ref.bib
  48. tidy:
  49. bibclean -max-width 0 ref.bib > ref.bib~
  50. mv ref.bib~ ref.bib
  51. $(ARTICLES:%=screening-of-%): screening-of-%:
  52. QUARTO_LOG_LEVEL=quiet \
  53. quarto render $*/index.qmd --to man --output - | man -l -
  54. $(ARTICLES:%=wordcount-of-%): wordcount-of-%:
  55. QUARTO_LOG_LEVEL=quiet \
  56. quarto render $*/index.qmd --to plain --columns=9999 --output - \
  57. | perl -nE 'next if /^-*$$/; $$bilag += $$_ =~ "^Bilag 1\\b"; $$chars += length unless $$bilag; END { say $$chars }'
  58. $(ARTICLES:%=turtle-from-%): turtle-from-%: _site/%/index.pdf
  59. @bin/xmp2rdfxml _site/$*/index.pdf \
  60. | rapper -i rdfxml -o turtle - $(BASE_IRI)$*/
  61. $(ARTICLES:%=dotgraph-from-%): dotgraph-from-%: _site/%/index.pdf
  62. @bin/xmp2rdfxml _site/$*/index.pdf \
  63. | rapper -i rdfxml -o dot - $(BASE_IRI)$*/
  64. diff-all: $(ARTICLES:%=diff-of-%)
  65. $(ARTICLES:%=diff-of-%): diff-of-%: %/changes.tex
  66. $(ARTICLES:%=%/changes.tex): %/changes.tex: %/a.tex %/b.tex
  67. latexdiff --type CULINECHBAR --subtype COLOR --replace-context2cmd '' $^ > $*/changes.tex
  68. perl -i -pe 's/\[pdftex\]{changebar}/[luatex]{changebar}/g' $*/changes.tex
  69. latexmk --gg --lualatex --cd --silent --Werror $*/changes.tex
  70. find $*/ -name 'changes.*' -not -name changes.pdf -delete
  71. rm -f $^
  72. $(ARTICLES:%=%/a.tex): %/a.tex:
  73. git switch --detach $(shell git describe --tags --abbrev=0)
  74. QUARTO_LOG_LEVEL=quiet \
  75. quarto render $*/index.qmd --to pdf -M keep-tex:true --output a.pdf
  76. mv --force $*/index.tex $@
  77. rm --force _site/a.pdf
  78. $(ARTICLES:%=%/b.tex): %/b.tex:
  79. git switch -
  80. QUARTO_LOG_LEVEL=quiet \
  81. quarto render $*/index.qmd --to pdf -M keep-tex:true --output b.pdf
  82. mv --force $*/index.tex $@
  83. rm --force _site/b.pdf