experimenting with automatic web version generation...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-04-02 16:15:03 +03:00
parent 9be9ed3062
commit 0a87ae4087
2 changed files with 106 additions and 79 deletions

View File

@ -9,6 +9,8 @@
.DEFAULT_GOAL := all .DEFAULT_GOAL := all
#SHELL := bash
ifeq ($(DEBUG),) ifeq ($(DEBUG),)
STDERR := > /dev/null STDERR := > /dev/null
endif endif
@ -79,6 +81,29 @@ spreads.tex: $(SPREAD_DIR) $(wildcard $(SPREAD_DIR)/*/*) $(TEMPLATE_FILES)
block.pdf: $(SPREADS) block.pdf: $(SPREADS)
# XXX need to also include covers and endpapers (optionally?)
web.tex: setup.tex
{ \
echo "% This file is generated via make web.tex" \
echo "% see the Makefile for info" \
echo "% do not edit directly" \
echo \
echo "\input{setup}" \
echo \
echo "\setlength\bleed{0mm}" \
echo "\setlength\bindingoffset{0mm}" \
echo \
echo "\ChangeLayout{endpaper}" \
echo \
echo "\pagecolor{black}" \
echo \
echo "\begin{document}" \
echo "\includepdf[pages={{},1-}, nup=2x1, delta=0.3mm 0.3mm]{block}" \
echo "\end{document}" \
echo \
} > $@
#---------------------------------------------------------------------- #----------------------------------------------------------------------
# production targets... # production targets...

View File

@ -1,79 +1,81 @@
Full book example Full book example
================= =================
This directory contains a full book example. This directory contains a full book example.
``` ```
book/ book/
├── templates/ . . . . . . . . . . . . Templates used to buld spreads ├── templates/ . . . . . . . . . . . . Templates used to buld spreads
│   └── ... (used by: make-spreads.sh) │   └── ... (used by: make-spreads.sh)
├── spreads/ . . . . . . . . . . . . . Spread layout ├── spreads/ . . . . . . . . . . . . . Spread layout
│   └── ... (used by: make-spreads.sh) │   └── ... (used by: make-spreads.sh)
├── captions/ . . . . . . . . . . . . . Image captions ├── captions/ . . . . . . . . . . . . . Image captions
│   └── ... (used by: make-spreads.sh) │   └── ... (used by: make-spreads.sh)
├── hi-res/ . . . . . . . . . . . . . . High resolution graphics ├── hi-res/ . . . . . . . . . . . . . . High resolution graphics
│   └── ... (used by: make-spreads.sh) │   └── ... (used by: make-spreads.sh)
├── Makefile ├── Makefile
├── setup.tex . . . . . . . . . . . . . Book setup and configuration ├── setup.tex . . . . . . . . . . . . . Book setup and configuration
│ This file contains all the book │ This file contains all the book
│ geometry, colors and other │ geometry, colors and other
│ settings common to all comoponents │ settings common to all comoponents
│ of the book. │ of the book.
├── block.tex . . . . . . . . . . . . . General page block layout. ├── block.tex . . . . . . . . . . . . . General page block layout.
├── spreads.tex . . . . . . . . . . . . Book spereads ├── spreads.tex . . . . . . . . . . . . Book spereads
│ (generated by: make-spreads.sh) │ (generated by: make-spreads.sh)
├── cover.tex ├── cover.tex
├── endpaper.tex ├── endpaper.tex
├── jacket.tex ├── jacket.tex
└── ... └── ...
``` ```
Note that this is by no means the only or most optomal project Note that this is by no means the only or most optomal project
structure, but it is a good enough starting point that evolved through structure, but it is a good enough starting point that evolved through
several, big and small project to start the next one from (at least several, big and small project to start the next one from (at least
for me, subjectively). for me, subjectively).
Building Building
-------- --------
To build all components: To build all components:
```shell ```shell
$ make all $ make all
``` ```
To build a specific component: To build a specific component:
```shell ```shell
$ make block.pdf $ make block.pdf
``` ```
`block.pdf` in this case. `block.pdf` in this case.
<!-- XXX add basic introspection to Makefike??? --> <!-- XXX add basic introspection to Makefike??? -->
Structure Structure
--------- ---------
### `setup.tex` ### `setup.tex`
### `spreads.tex` ### `spreads.tex`
### `cover.tex` / `jacket.tex` / `endpaper.tex` / .. ### `cover.tex` / `jacket.tex` / `endpaper.tex` / ..
### `web.tex` ### `web.tex`
<!-- XXX this is quite generic, can we generate it? -->
Workflow
--------
Workflow
XXX --------
XXX
For information about building spreads see:
[make-spreads.sh](../../scripts/README.md)
For information about building spreads see:
[make-spreads.sh](../../scripts/README.md)
<!-- vim:set ts=4 sw=4 nowrap : -->
<!-- vim:set ts=4 sw=4 nowrap : -->