From 3be26c1dce5aa9ef7f260ccaa7604560f6b2aeae Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Wed, 8 May 2024 18:54:45 +0200 Subject: Added an option to specify a template without having to copy all the files --- common/Makefile.common | 12 ++++++++---- 1 file 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' $@ -- cgit v1.2.3