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