aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 4caad12dc41b18a5ecb813af8889d5b5c7e9bd88 (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 $<~ $<
  40. pad-export-use: use/index.qmd
  41. hedgedoc export --md aFt_nNkYTQibl0CQrBJhtQ $<
  42. perl -g -e 's/\s*\z/\n/' $<
  43. $(ARTICLES:%=pad-import-%): pad-import-%:
  44. hedgedoc import $*/index.qmd
  45. pad-import-ref:
  46. hedgedoc import ref.bib
  47. tidy:
  48. bibclean -max-width 0 ref.bib > ref.bib~
  49. mv ref.bib~ ref.bib
  50. $(ARTICLES:%=screening-of-%): screening-of-%:
  51. QUARTO_LOG_LEVEL=quiet \
  52. quarto render $*/index.qmd --to man --output - | man -l -
  53. $(ARTICLES:%=wordcount-of-%): wordcount-of-%:
  54. QUARTO_LOG_LEVEL=quiet \
  55. quarto render $*/index.qmd --to plain --columns=9999 --output - \
  56. | perl -nE 'next if /^-*$$/; $$bilag += $$_ =~ "^Bilag 1\\b"; $$chars += length unless $$bilag; END { say $$chars }'
  57. $(ARTICLES:%=turtle-from-%): turtle-from-%:
  58. @bin/xmp2rdfxml _site/$*/S*.pdf \
  59. | rapper -i rdfxml -o turtle - $(BASE_IRI)$*/
  60. $(ARTICLES:%=dotgraph-from-%): dotgraph-from-%:
  61. @bin/xmp2rdfxml _site/$*/S*.pdf \
  62. | rapper -i rdfxml -o dot - $(BASE_IRI)$*/
  63. diff-all: $(ARTICLES:%=diff-of-%)
  64. $(ARTICLES:%=diff-of-%): diff-of-%: %/changes.tex
  65. $(ARTICLES:%=%/changes.tex): %/changes.tex: %/a.tex %/b.tex
  66. latexdiff --type CULINECHBAR --subtype COLOR --replace-context2cmd '' $^ > $*/changes.tex
  67. perl -i -pe 's/\[pdftex\]{changebar}/[luatex]{changebar}/g' $*/changes.tex
  68. latexmk --gg --lualatex --cd --silent --Werror $*/changes.tex
  69. find $*/ -name 'changes.*' -not -name changes.pdf -delete
  70. rm -f $^
  71. $(ARTICLES:%=%/a.tex): %/a.tex:
  72. git switch --detach $(shell git describe --tags --abbrev=0)
  73. QUARTO_LOG_LEVEL=quiet \
  74. quarto render $*/index.qmd --to pdf -M keep-tex:true --output a.pdf
  75. mv --force $*/index.tex $@
  76. rm --force _site/a.pdf
  77. $(ARTICLES:%=%/b.tex): %/b.tex:
  78. git switch -
  79. QUARTO_LOG_LEVEL=quiet \
  80. quarto render $*/index.qmd --to pdf -M keep-tex:true --output b.pdf
  81. mv --force $*/index.tex $@
  82. rm --force _site/b.pdf