From c4aebdaddbb4806e98070a833f3608f18fc0a596 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 13 Oct 2024 20:28:51 +0200 Subject: copy readme and rename makefile --- book/GNUmakefile | 47 +++++++++++++++++++++++++++++++++++++++++++++++ book/makefile | 49 ------------------------------------------------- book/readme.md | 8 ++++++++ 3 files changed, 55 insertions(+), 49 deletions(-) create mode 100644 book/GNUmakefile delete mode 100644 book/makefile create mode 100644 book/readme.md diff --git a/book/GNUmakefile b/book/GNUmakefile new file mode 100644 index 00000000..ab753255 --- /dev/null +++ b/book/GNUmakefile @@ -0,0 +1,47 @@ + +noop = +space = $(noop) $(noop) +comma = , +langs = $(patsubst locale/%.ini,%,$(wildcard locale/*.ini)) + +s_pages = 01,02,03,04,05,06,07,08,09,10,11 +s_langs = $(subst $(space),$(comma),$(langs)) +png_pages = $(shell echo out/book_{$(s_pages)}.{$(s_langs)}.png) +webp_pages = $(shell echo out/book_{$(s_pages)}.{$(s_langs)}.webp) +svg_pages = $(shell echo out/book_{$(s_pages)}.{$(s_langs)}.svg) +pdfs = $(shell echo out/book.{$(s_langs)}.pdf) + +ALL = out/book.webp.tar.zst out/book.svg.tar.zst \ + $(pdfs) $(png_pages) $(webp_pages) $(svg_pages) + +JSR = deno run + +.PHONY: all +all: $(ALL) + +out: + @mkdir -p out + +book.json: book.js + DENO_NO_UPDATE_CHECK=1 $(JSR) $< > $@ + +out/book_01.%.png: book.typ book.json locale/%.ini out + typst compile --input lang=$(subst out/,,$(*)) $< out/book_\{n\}.$(subst out/,,$(*)).png +out/book_01.%.svg: book.typ book.json locale/%.ini out + typst compile --input lang=$(subst out/,,$(*)) $< out/book_\{n\}.$(subst out/,,$(*)).svg +out/book.%.pdf: book.typ book.json locale/%.ini out + typst compile --input lang=$(subst out/,,$(*)) $< $@ + +out/%.webp: out/%.png + ffmpeg -i $< -y $@ + +out/book.svg.tar.zst: $(svg_pages) + tar -cf $@ $^ +out/book.webp.tar.zst: $(webp_pages) + tar -cf $@ $^ + +.PHONY: clean +clean: + rm -rf out + rm -f book.json + diff --git a/book/makefile b/book/makefile deleted file mode 100644 index 4bdab4dc..00000000 --- a/book/makefile +++ /dev/null @@ -1,49 +0,0 @@ - -noop = -space = $(noop) $(noop) -comma = , -langs = $(patsubst locale/%.ini,%,$(wildcard locale/*.ini)) - -s_pages = 01,02,03,04,05,06,07,08,09,10,11 -s_langs = $(subst $(space),$(comma),$(langs)) -png_pages = $(shell echo out/book_{$(s_pages)}.{$(s_langs)}.png) -webp_pages = $(shell echo out/book_{$(s_pages)}.{$(s_langs)}.webp) -svg_pages = $(shell echo out/book_{$(s_pages)}.{$(s_langs)}.svg) -pdfs = $(shell echo out/book.{$(s_langs)}.pdf) - -ALL = out/book.webp.tar.zst out/book.svg.tar.zst \ - $(pdfs) $(png_pages) $(webp_pages) $(svg_pages) - -JSR = deno run - - - -.PHONY: all -all: $(ALL) - -out: - @mkdir -p out - -book.json: book.js - DENO_NO_UPDATE_CHECK=1 $(JSR) $< > $@ - -out/book_01.%.png: book.typ book.json locale/%.ini out - typst compile --input lang=$(subst out/,,$(*)) $< out/book_\{n\}.$(subst out/,,$(*)).png -out/book_01.%.svg: book.typ book.json locale/%.ini out - typst compile --input lang=$(subst out/,,$(*)) $< out/book_\{n\}.$(subst out/,,$(*)).svg -out/book.%.pdf: book.typ book.json locale/%.ini out - typst compile --input lang=$(subst out/,,$(*)) $< $@ - -out/%.webp: out/%.png - ffmpeg -i $< -y $@ - -out/book.svg.tar.zst: $(svg_pages) - tar -cf $@ $^ -out/book.webp.tar.zst: $(webp_pages) - tar -cf $@ $^ - -.PHONY: clean -clean: - rm -rf out - rm -f book.json - diff --git a/book/readme.md b/book/readme.md new file mode 100644 index 00000000..8e410718 --- /dev/null +++ b/book/readme.md @@ -0,0 +1,8 @@ +# Hurry Curry! Recipe Book + +## Building + +The book is built with Typst and uses imagery from the recipe-book repository. +These are expected to be accessible at `book-repo/____.jpeg`, so symlinking or +cloning it as book-repo should suffice. Then just `make` or for previewing just +`make out/book.xx.pdf`. -- cgit v1.2.3-70-g09d2