aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2025-07-09 09:21:58 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2025-07-09 09:21:58 +0200
commit258fa90f1921acdfe3c472e725a035d58b249f3b (patch)
tree712996b7f8556b9f82fbfc7ebb3531d8ea4f57ab /Makefile
parent391541d62ac638b258e6244a237b72a15db88e24 (diff)
downloadconstance-ring-258fa90f1921acdfe3c472e725a035d58b249f3b.tar.gz
constance-ring-258fa90f1921acdfe3c472e725a035d58b249f3b.tar.bz2
constance-ring-258fa90f1921acdfe3c472e725a035d58b249f3b.tar.xz
constance-ring-258fa90f1921acdfe3c472e725a035d58b249f3b.zip
Spellchecking A
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile28
1 files changed, 22 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index cc7b753..7c903d7 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,8 @@ INPUT=2025-07-01T2031_NB_generated.pdf
# ocrmypdf -l nor --force-ocr --sidecar $(pwd)/sidecar.txt $(pwd)/2025-07-01T2031_NB_generated.printed.pdf $(pwd)/2025-07-01T2031_NB_generated.ocr.pdf
+MAKEFLAGS += -r
+
all: constance-ring.epub
JPGs:=$(wildcard image/*.jpg)
@@ -49,18 +51,32 @@ stage-4.txt: stage-3.txt Makefile
stage-5.txt: stage-4.txt convert2.awk
@echo '#' $@
awk -f convert2.awk $< > $@.tmp
- mv $@.tmp $@
+ @mv $@.tmp $@
-stage-6.md spellcheck-words: stage-5.txt Makefile
+stage-6.md: stage-5.txt Makefile
@echo '#' $@
@pandoc --from markdown -o $@.tmp.md $<
@mv $@.tmp.md $@
- @echo spellcheck
- @hunspell -p dict -d nb_NO -l < $@ | sort | uniq -c | sort -n > spellcheck-words
-constance-ring.epub: header.md stage-6.md
+# This actually updates dict by sorting and removing leading numbers/spaces.
+dict.tmp: dict
+ cat dict |\
+ sed "s,^[0-9 ]*,," |\
+ sort |\
+ grep -v "^$$" |\
+ uniq > dict.tmp && cp dict.tmp dict
+
+spellcheck: stage-6.md
+ hunspell -p dict -d nb_NO stage-6.md dict.tmp
+
+spellcheck-words: stage-6.md dict.tmp
+ @echo hunspell
+ hunspell -p dict -d nb_NO -l < $< | sort | uniq -c | sort -n > $@.tmp
+ @mv $@.tmp spellcheck-words
+
+constance-ring.epub: header.md stage-6.md spellcheck-words
@echo '#' $@
- @pandoc --toc -o $@ $^
+ @pandoc --toc -o $@ $(filter %.md,$^)
.PHONY: clean
clean: