- eBook 252 S., Print 300 S., _print_pages 300 - Wrap 12,9256 × 9,25 in; Rücken Weiß 0,6756 in / 17,1602 mm - EPUB 39 Figuren / 40 Bilder (S-11 unembedded) - Bericht audits/behebungsplan-bp07-2026-11-07.md
171 lines
6.2 KiB
Makefile
171 lines
6.2 KiB
Makefile
# Justfile — PDF-Pipeline für „Coding Agents in der Praxis“
|
||
#
|
||
# pandoc + lualatex + KOMA-Template.
|
||
# TeX Live (KOMA-Script / scrbook) kommt vom Host.
|
||
#
|
||
# Outputs:
|
||
# just pdf → dist/coding-agents-praxis.pdf (A4 eBook)
|
||
# just pdf-print → dist/coding-agents-praxis-print.pdf (KDP 6×9 B/W)
|
||
# just epub → dist/coding-agents-praxis.epub (Kindle/KDP)
|
||
# just qa-epub → structural QA for the EPUB only
|
||
|
||
default: pdf
|
||
|
||
# resource-path: Manuskript, Leser-Inhalte und Assets (Links im MD)
|
||
_resource_path := ".:manuskript:templates:checklists:assets:assets/illustrations:assets/cover"
|
||
|
||
# Print: grayscale stage mirrors MD paths (assets/illustrations/… under
|
||
# build/print-assets/). First path wins → gray before RGB originals.
|
||
_print_resource_path := "build/print-assets:.:manuskript:templates:checklists:assets:assets/illustrations:assets/cover"
|
||
|
||
# Gemessene Print-Seitenzahl (pdfinfo); seiten.py vergleicht sie mit der PDF.
|
||
_print_pages := "300"
|
||
|
||
assemble:
|
||
@python3 scripts/assemble_book.py
|
||
|
||
pdf-styled: assemble
|
||
@mkdir -p dist
|
||
pandoc build/book.md \
|
||
--pdf-engine=lualatex \
|
||
--template=pdf/templates/guide.tex \
|
||
-H pdf/styles/guide-colors.tex \
|
||
--metadata-file=pdf/metadata.yaml \
|
||
--lua-filter=pdf/filters/takeaways.lua \
|
||
--lua-filter=pdf/filters/tables.lua \
|
||
--lua-filter=pdf/filters/figure-numbers.lua \
|
||
--resource-path={{_resource_path}} \
|
||
-V lang=de-DE \
|
||
-V papersize=a4 \
|
||
-V colorlinks \
|
||
--toc \
|
||
-o dist/coding-agents-praxis.pdf
|
||
|
||
pdf: pdf-styled
|
||
|
||
pdf-draft: assemble
|
||
@mkdir -p dist
|
||
pandoc build/book.md \
|
||
--pdf-engine=lualatex \
|
||
--template=pdf/templates/guide.tex \
|
||
-H pdf/styles/guide-colors.tex \
|
||
--metadata-file=pdf/metadata.yaml \
|
||
--lua-filter=pdf/filters/takeaways.lua \
|
||
--lua-filter=pdf/filters/tables.lua \
|
||
--lua-filter=pdf/filters/figure-numbers.lua \
|
||
--resource-path={{_resource_path}} \
|
||
-V lang=de-DE \
|
||
-V papersize=a4 \
|
||
-V colorlinks \
|
||
-V draft=true \
|
||
--toc \
|
||
-o dist/coding-agents-praxis-draft.pdf
|
||
|
||
pdf-plain: assemble
|
||
@mkdir -p dist
|
||
pandoc build/book.md \
|
||
--pdf-engine=lualatex \
|
||
-V documentclass=scrbook \
|
||
-V lang=de-DE \
|
||
-V papersize=a4 \
|
||
--lua-filter=pdf/filters/tables.lua \
|
||
--resource-path={{_resource_path}} \
|
||
--toc \
|
||
-o dist/coding-agents-praxis-plain.pdf
|
||
|
||
# --- KDP Paperback Interior (6×9, grayscale) --------------------------------
|
||
|
||
print-assets:
|
||
@python3 scripts/prepare_print_assets.py
|
||
|
||
pdf-print: assemble print-assets
|
||
@mkdir -p dist
|
||
pandoc build/book.md \
|
||
--pdf-engine=lualatex \
|
||
--template=pdf/templates/guide.tex \
|
||
-H pdf/print/print-colors.tex \
|
||
--metadata-file=pdf/print/metadata.yaml \
|
||
--lua-filter=pdf/filters/takeaways.lua \
|
||
--lua-filter=pdf/filters/tables.lua \
|
||
--lua-filter=pdf/filters/figure-numbers.lua \
|
||
--resource-path={{_print_resource_path}} \
|
||
--syntax-highlighting=monochrome \
|
||
-V lang=de-DE \
|
||
-V printmode=true \
|
||
--toc \
|
||
-o dist/coding-agents-praxis-print.pdf
|
||
|
||
# Optional: Ghostscript grayscale/prepress pass (KDP-freundlicher, best-effort)
|
||
pdf-print-optimize:
|
||
@test -f dist/coding-agents-praxis-print.pdf || (echo "Run just pdf-print first" && exit 1)
|
||
@command -v gs >/dev/null || (echo "Ghostscript (gs) not found" && exit 1)
|
||
gs -dBATCH -dNOPAUSE -dSAFER -sDEVICE=pdfwrite \
|
||
-dCompatibilityLevel=1.5 \
|
||
-dPDFSETTINGS=/prepress \
|
||
-dColorConversionStrategy=/Gray \
|
||
-dProcessColorModel=/DeviceGray \
|
||
-dEmbedAllFonts=true \
|
||
-dSubsetFonts=true \
|
||
-sOutputFile=dist/coding-agents-praxis-print-opt.pdf \
|
||
dist/coding-agents-praxis-print.pdf
|
||
@mv dist/coding-agents-praxis-print-opt.pdf dist/coding-agents-praxis-print.pdf
|
||
@echo "optimized → dist/coding-agents-praxis-print.pdf"
|
||
|
||
# --- KDP Kindle EPUB ---------------------------------------------------------
|
||
|
||
# EPUB-only: resized images under build/epub-assets/ (does not touch PDF/print).
|
||
# Stable OPF identifier — do not rotate casually (KDP update identity).
|
||
_epub_resource_path := "build/epub-assets:.:manuskript:templates:checklists:assets"
|
||
_epub_id := "urn:uuid:6d2f1b8a-4c7e-4a15-9f3d-2b8e5c1a7d94"
|
||
|
||
epub: assemble
|
||
@python3 scripts/prepare_epub.py
|
||
@mkdir -p dist
|
||
pandoc build/epub.md \
|
||
--lua-filter=pdf/filters/figure-numbers.lua \
|
||
--resource-path={{_epub_resource_path}} \
|
||
--css=pdf/epub/epub.css \
|
||
--epub-cover-image=assets/cover/cover-front.jpg \
|
||
--epub-metadata=pdf/epub/epub-metadata.xml \
|
||
--metadata title="Coding Agents in der Praxis" \
|
||
--metadata subtitle="Ein pragmatischer Leitfaden zum effektiven Einsatz von LLM-basierten Coding-Agents unter Berücksichtigung ihrer Limitationen" \
|
||
--metadata author="Martin Richardt" \
|
||
--metadata lang=de-DE \
|
||
--metadata toc-title="Inhaltsverzeichnis" \
|
||
--metadata rights="© 2026 Martin Richardt. Alle Rechte vorbehalten." \
|
||
--metadata identifier={{_epub_id}} \
|
||
--toc --toc-depth=1 \
|
||
--split-level=1 \
|
||
--epub-title-page=false \
|
||
-o dist/coding-agents-praxis.epub
|
||
@# Kindle E20006/E21011: inject title-type=main (+ subtitle), dedupe meta
|
||
@python3 scripts/fix_epub_opf.py dist/coding-agents-praxis.epub
|
||
@echo "epub → dist/coding-agents-praxis.epub"
|
||
@python3 scripts/check_epub.py dist/coding-agents-praxis.epub
|
||
|
||
qa-epub:
|
||
@python3 scripts/check_epub.py dist/coding-agents-praxis.epub
|
||
|
||
# Tight-Loop MD (Manuskript + Templates + Checklisten + AGENTS.md).
|
||
# Scope/Regeln: .markdownlint-cli2.jsonc — kein PDF.
|
||
markdownlint:
|
||
npx --yes markdownlint-cli2@0.18.1
|
||
|
||
link-check:
|
||
python3 scripts/check_md_links.py
|
||
|
||
qa:
|
||
@python3 scripts/check_pdf.py
|
||
|
||
qa-print:
|
||
@python3 scripts/check_pdf.py --pdf dist/coding-agents-praxis-print.pdf --mode print
|
||
|
||
all: pdf qa
|
||
|
||
all-print: pdf-print qa-print
|
||
|
||
clean:
|
||
@rm -rf build
|
||
@rm -f dist/*.pdf dist/*.epub dist/*.aux dist/*.log dist/*.out dist/*.toc
|
||
@echo "cleaned build/ and dist/*.{pdf,epub}"
|