aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 4c0c63c4a860f66fbb32e521a91e46a19bdcff7b (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
  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-%) pad-export-code-gantt
  31. pad-export-superteam: ref.bib
  32. hedgedoc export --md 8krqOrqnR0iAIExDTtTrxw $<
  33. perl -g -e 's/\s*\z/\n/' $<
  34. pad-export-learn: learn/index.qmd
  35. hedgedoc export --md CP1pFdg_QlGiYxtKc9IHBg $<
  36. perl -g -e 's/\s*\z/\n/' $<
  37. pad-export-code: code/index.qmd
  38. hedgedoc export --md 8QGRP0iTRwe7hFmoAX4QnA $<
  39. perl -g -e 's/\s*\z/\n/' $<
  40. pad-export-code-gantt: code/_gantt.qmd
  41. hedgedoc export --md mJnfBHZ7Qr2W1Hu-QppL8A $<~
  42. bin/hedgedoc2quarto $<~ $<
  43. pad-export-use: use/index.qmd
  44. hedgedoc export --md aFt_nNkYTQibl0CQrBJhtQ $<
  45. perl -g -e 's/\s*\z/\n/' $<
  46. $(PAD_ARTICLES:%=pad-import-%): pad-import-%:
  47. hedgedoc import $*/index.qmd
  48. pad-import-ref:
  49. hedgedoc import ref.bib
  50. lint: lint-markdown
  51. lint-markdown:
  52. @mdl --ignore-front-matter --style .mdl.rb $(filter-out %/index.qmd,$(wildcard $(addsuffix /*.qmd,$(TIDY_MARKDOWN))))
  53. tidy: tidy-bibtex tidy-perl
  54. tidy-bibtex:
  55. bibclean -max-width 0 ref.bib > ref.bib~
  56. mv ref.bib~ ref.bib
  57. tidy-perl:
  58. perltidy -b -bext='/' --profile=.perltidyrc $(PERL_FILES)
  59. $(ARTICLES:%=screening-of-%): screening-of-%:
  60. QUARTO_LOG_LEVEL=quiet \
  61. quarto render $*/index.qmd --to man --output - | man -l -
  62. $(ARTICLES:%=wordcount-of-%): wordcount-of-%:
  63. QUARTO_LOG_LEVEL=quiet \
  64. quarto render $*/index.qmd --to plain --columns=9999 --output - \
  65. | perl -nE 'next if /^-*$$/; $$bilag += $$_ =~ "^Bilag 1\\b"; $$chars += length unless $$bilag; END { say $$chars }'
  66. $(ARTICLES:%=turtle-from-%): turtle-from-%:
  67. @bin/xmp2rdfxml _site/$*/S*.pdf \
  68. | rapper -i rdfxml -o turtle - $(BASE_IRI)$*/
  69. $(ARTICLES:%=dotgraph-from-%): dotgraph-from-%:
  70. @bin/xmp2rdfxml _site/$*/S*.pdf \
  71. | rapper -i rdfxml -o dot - $(BASE_IRI)$*/
  72. diff-all: $(ARTICLES:%=diff-of-%)
  73. $(ARTICLES:%=diff-of-%): diff-of-%: %/changes.tex
  74. $(ARTICLES:%=%/changes.tex): %/changes.tex: %/a.tex %/b.tex
  75. latexdiff --type CULINECHBAR --subtype COLOR --replace-context2cmd '' $^ > $*/changes.tex
  76. perl -i -pe 's/\[pdftex\]{changebar}/[luatex]{changebar}/g' $*/changes.tex
  77. latexmk --gg --lualatex --cd --silent --Werror $*/changes.tex
  78. find $*/ -name 'changes.*' -not -name changes.pdf -delete
  79. rm -f $^
  80. $(ARTICLES:%=%/a.tex): %/a.tex:
  81. git switch --detach $(shell git describe --tags --abbrev=0)
  82. QUARTO_LOG_LEVEL=quiet \
  83. quarto render $*/index.qmd --to pdf -M keep-tex:true --output a.pdf
  84. mv --force $*/index.tex $@
  85. rm --force _site/a.pdf
  86. $(ARTICLES:%=%/b.tex): %/b.tex:
  87. git switch -
  88. QUARTO_LOG_LEVEL=quiet \
  89. quarto render $*/index.qmd --to pdf -M keep-tex:true --output b.pdf
  90. mv --force $*/index.tex $@
  91. rm --force _site/b.pdf