docs: The Dictionary of v4 -- every live word, alphabetical, its stack notation and description; built and published with every release (#157) [skip ci]
make dictionary -> build/docs/Dictionary.pdf (20 pages): mkdictionary.py checks docs/reference/v4-dictionary.tsv against the booted system's words first, so a stale dictionary fails the build; then Markdown, pandoc, docs/book/dictionary.tex (the books' preamble, its own title page: version and commit). Quoted FORTH tokens set as code, so their quotes print straight. The nightly's docs stage builds it; publish sends classifier dictionary; the Gitea release attaches it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GE3SDvQn5EoxdGufk84zz2
This commit is contained in:
+35
-1
@@ -63,9 +63,18 @@ FABRIC_DIR := $(OUT)/fabric
|
||||
FABRIC_PDF := $(OUT)/BookOfFabric.pdf
|
||||
FABRIC_FRAGS := $(foreach n,fabric-0 fabric-1 fabric-2 fabric-3 fabric-3-5 fabric-3-6 fabric-3-7 fabric-4,$(GEN)/$(n).tex)
|
||||
|
||||
.PHONY: all fabric tools FORCE
|
||||
# The Dictionary of v4 (#157): every live word, alphabetical, with its stack
|
||||
# notation and description -- `make dictionary` -> build/docs/Dictionary.pdf.
|
||||
# Its names are the booted system's (v4/tools/mkdictionary.py); the check
|
||||
# refuses a table that has fallen behind them.
|
||||
DICT_DIR := $(OUT)/dictionary
|
||||
DICT_PDF := $(OUT)/Dictionary.pdf
|
||||
DICT_TSV := docs/reference/v4-dictionary.tsv
|
||||
|
||||
.PHONY: all fabric dictionary tools FORCE
|
||||
all: $(PDF)
|
||||
fabric: $(FABRIC_PDF)
|
||||
dictionary: $(DICT_PDF)
|
||||
|
||||
tools:
|
||||
@missing=""; \
|
||||
@@ -113,6 +122,8 @@ $(VAR_DIR)/meta.tex: FORCE
|
||||
$(meta_cmds)
|
||||
$(FABRIC_DIR)/meta.tex: FORCE
|
||||
$(meta_cmds)
|
||||
$(DICT_DIR)/meta.tex: FORCE
|
||||
$(meta_cmds)
|
||||
|
||||
FORCE:
|
||||
|
||||
@@ -137,3 +148,26 @@ $(FABRIC_PDF): $(BOOK_DIR)/fabric.tex $(BOOK_DIR)/preamble.tex $(FABRIC_FRAGS) $
|
||||
echo "Error: LaTeX failed; full log: $(FABRIC_DIR)/fabric.log"; exit 1; }
|
||||
@cp $(FABRIC_DIR)/fabric.pdf $@
|
||||
@echo " PDF $@"
|
||||
|
||||
# the live word list needs the hosted v4; the check fails the build on a word with no entry, an
|
||||
# unfinished entry, or an entry for a word the system no longer has
|
||||
$(GEN)/dictionary-words.md: $(DICT_TSV) v4/tools/mkdictionary.py FORCE | tools
|
||||
@mkdir -p $(GEN)
|
||||
@$(MAKE) --no-print-directory -C v4 hosted >/dev/null
|
||||
@python3 v4/tools/mkdictionary.py check $(DICT_TSV)
|
||||
@python3 v4/tools/mkdictionary.py md $(DICT_TSV) $@
|
||||
|
||||
$(GEN)/dictionary-words.tex: $(GEN)/dictionary-words.md $(PANDOC_FILTERS) | tools
|
||||
@echo " PANDOC $< -> $@"
|
||||
@$(PANDOC) $(PANDOC_FLAGS) --id-prefix=dictionary- $< -o $@
|
||||
|
||||
TEXINPUTS_DICT := $(abspath $(DICT_DIR)):$(abspath $(GEN)):$(abspath $(BOOK_DIR)):
|
||||
|
||||
$(DICT_PDF): $(BOOK_DIR)/dictionary.tex $(BOOK_DIR)/preamble.tex $(GEN)/dictionary-words.tex $(GEN)/pandoc-highlighting.tex $(DICT_DIR)/meta.tex | tools
|
||||
@echo " LATEXMK $(BOOK_DIR)/dictionary.tex -> $@"
|
||||
@TEXINPUTS=$(TEXINPUTS_DICT) $(LATEXMK) -xelatex -interaction=nonstopmode -halt-on-error \
|
||||
-file-line-error -outdir=$(DICT_DIR) $(BOOK_DIR)/dictionary.tex > $(DICT_DIR)/latexmk.log 2>&1 || { \
|
||||
grep -A4 -E '^(.*:[0-9]+:|!)' $(DICT_DIR)/dictionary.log | head -40; \
|
||||
echo "Error: LaTeX failed; full log: $(DICT_DIR)/dictionary.log"; exit 1; }
|
||||
@cp $(DICT_DIR)/dictionary.pdf $@
|
||||
@echo " PDF $@"
|
||||
|
||||
Reference in New Issue
Block a user