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