summaryrefslogtreecommitdiff
path: root/Makefile
blob: df04b9398136ac0483c783f56d69a23a5e8ff638 (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 = worlding
  6. ARTICLES = 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_ARTICLES:%=pad-export-%)
  31. pad-export-worlding: ref.bib worlding/index.qmd \
  32. $(patsubst %,worlding/_%.qmd,baggrund teori_og_metode undersøgelser konklusion perspektivering kilder planer)
  33. ref.bib:
  34. hedgedoc export --md 8krqOrqnR0iAIExDTtTrxw $@
  35. perl -g -e 's/\s*\z/\n/' $@
  36. worlding/index.qmd:
  37. hedgedoc export --md EXC6tW48SYu0_s_MA6cORw $@
  38. perl -g -e 's/\s*\z/\n/' $@
  39. worlding/_baggrund.qmd:
  40. hedgedoc export --md mGHhKvXyQ5SVeTIU11isQQ $@
  41. perl -g -e 's/\s*\z/\n/' $@
  42. worlding/_teori_og_metode.qmd:
  43. hedgedoc export --md 5AbKoR-mTOij6TsCMFFDRw $@
  44. perl -g -e 's/\s*\z/\n/' $@
  45. worlding/_undersøgelser.qmd:
  46. hedgedoc export --md 5XR69V5rSEm9LwsLNtSXcQ $@
  47. perl -g -e 's/\s*\z/\n/' $@
  48. worlding/_konklusion.qmd:
  49. hedgedoc export --md ofRbx2f4QcWLR-o_kqTNCQ $@
  50. perl -g -e 's/\s*\z/\n/' $@
  51. worlding/_perspektivering.qmd:
  52. hedgedoc export --md lU8aUxCkR5GNrP-8frklFA $@
  53. perl -g -e 's/\s*\z/\n/' $@
  54. worlding/_kilder.qmd:
  55. hedgedoc export --md Jt6S4tAhQM-BUrAP-OllCg $@
  56. perl -g -e 's/\s*\z/\n/' $@
  57. worlding/_planer.qmd:
  58. hedgedoc export --md qfFl3xiaQWCbpoyNPbNsEA $@~
  59. bin/hedgedoc2quarto $@~ $@
  60. $(PAD_ARTICLES:%=pad-import-%): pad-import-%:
  61. hedgedoc import $*/index.qmd
  62. pad-import-ref:
  63. hedgedoc import ref.bib
  64. lint: lint-markdown
  65. lint-markdown:
  66. @mdl --ignore-front-matter --style .mdl.rb $(filter-out %/index.qmd,$(wildcard $(addsuffix /*.qmd,$(TIDY_MARKDOWN))))
  67. tidy: tidy-bibtex tidy-perl
  68. tidy-bibtex:
  69. bibclean -max-width 0 ref.bib > ref.bib~
  70. mv ref.bib~ ref.bib
  71. tidy-perl:
  72. perltidy -b -bext='/' --profile=.perltidyrc $(PERL_FILES)
  73. $(ARTICLES:%=screening-of-%): screening-of-%:
  74. QUARTO_LOG_LEVEL=quiet \
  75. quarto render $*/index.qmd --to man --output - | man -l -
  76. $(ARTICLES:%=wordcount-of-%): wordcount-of-%:
  77. QUARTO_LOG_LEVEL=quiet \
  78. quarto render $*/index.qmd --to plain --columns=9999 --output - \
  79. | perl -nE 'next if /^-*$$/; $$bilag += $$_ =~ "^Bilag 1\\b"; $$chars += length unless $$bilag; END { say $$chars }'
  80. $(ARTICLES:%=turtle-from-%): turtle-from-%:
  81. @bin/xmp2rdfxml _site/$*/S*.pdf \
  82. | rapper -i rdfxml -o turtle - $(BASE_IRI)$*/
  83. $(ARTICLES:%=dotgraph-from-%): dotgraph-from-%:
  84. @bin/xmp2rdfxml _site/$*/S*.pdf \
  85. | rapper -i rdfxml -o dot - $(BASE_IRI)$*/
  86. diff-all: $(ARTICLES:%=diff-of-%)
  87. $(ARTICLES:%=diff-of-%): diff-of-%: %/changes.tex
  88. $(ARTICLES:%=%/changes.tex): %/changes.tex: %/a.tex %/b.tex
  89. latexdiff --type CULINECHBAR --subtype COLOR --replace-context2cmd '' $^ > $*/changes.tex
  90. perl -i -pe 's/\[pdftex\]{changebar}/[luatex]{changebar}/g' $*/changes.tex
  91. latexmk --gg --lualatex --cd --silent --Werror $*/changes.tex
  92. find $*/ -name 'changes.*' -not -name changes.pdf -delete
  93. rm -f $^
  94. $(ARTICLES:%=%/a.tex): %/a.tex:
  95. git switch --detach $(shell git describe --tags --abbrev=0)
  96. QUARTO_LOG_LEVEL=quiet \
  97. quarto render $*/index.qmd --to pdf -M keep-tex:true --output a.pdf
  98. mv --force $*/index.tex $@
  99. rm --force _site/a.pdf
  100. $(ARTICLES:%=%/b.tex): %/b.tex:
  101. git switch -
  102. QUARTO_LOG_LEVEL=quiet \
  103. quarto render $*/index.qmd --to pdf -M keep-tex:true --output b.pdf
  104. mv --force $*/index.tex $@
  105. rm --force _site/b.pdf