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