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