diff options
author | Sébastien Dailly <sebastien@dailly.me> | 2024-05-08 18:54:45 +0200 |
---|---|---|
committer | Sébastien Dailly <sebastien@dailly.me> | 2024-05-08 18:54:45 +0200 |
commit | 3be26c1dce5aa9ef7f260ccaa7604560f6b2aeae (patch) | |
tree | 4121a3777ba34e4ee23674986d91f3b23a14d3fe /common | |
parent | 0a55a73be010169b8f100c0174c2cbad3cf979c4 (diff) |
Added an option to specify a template without having to copy all the files
Diffstat (limited to 'common')
-rw-r--r-- | common/Makefile.common | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/common/Makefile.common b/common/Makefile.common index 92ac79a..460bdc7 100644 --- a/common/Makefile.common +++ b/common/Makefile.common @@ -1,5 +1,6 @@ TEX=$(shell command -v lualatex xelatex | head -n 1) SOURCE=. +MODEL ?= . SRC =$(wildcard *.rst) SVG =$(wildcard content/*.svg) @@ -12,7 +13,7 @@ all: $(PDFS) BIBS =$(wildcard *.bib) DIR = $(sort $(shell find $(SOURCE) -name '*.rst' -print)) -SOURCES = $(sort $(wildcard resources/*.tex) ) +SOURCES := $(sort $(wildcard $(MODEL)/resources/*.tex) ) null := space := $(null) # @@ -24,9 +25,12 @@ TEX_BIBS := $(subst $(space),$(comma),$(strip $(BIBS))) # EXTRA_RST_OPTIONS ?= +EXTRA_STYLES ?= + + # Remove the comments and the empty lines from the module list file -PACK = $(shell sed -e 's/\#.*$$//' -e '/^\s$$/d' resources/modules) -PACKAGES := $(subst $(space),$(comma),$(strip $(PACK))) +PACK = $(shell sed -e 's/\#.*$$//' -e '/^\s$$/d' $(MODEL)/resources/modules) +PACKAGES = $(subst $(space),$(comma),$(strip $(PACK))) tmp: mkdir tmp @@ -42,7 +46,7 @@ tmp/%.tex: %.rst $(INCLUDED_PDF) $(SOURCES)| tmp --documentoption=12pt,A4,table \ --syntax-highlight=short \ $(EXTRA_RST_OPTIONS) \ - --stylesheet=$(PACKAGES),$(TEX_STYLE) $< $@ + --stylesheet=$(PACKAGES),$(EXTRA_STYLES),$(TEX_STYLE) $< $@ sed -i -e 's/continued on next page/suite sur la page suivante/;s|^%$$||' $@ sed -i -e 's/admonition-/admonition/g' $@ |