-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
64 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
$(call check_defined, HTMLTEMPLATE, Template for main document in HTML) | ||
$(call check_defined, HTMLCHAPTERTEMPLATE, Template for individual chapters in HTML) | ||
|
||
.phony: html htmlbook htmlchapters html-clean | ||
|
||
html: htmlbook htmlchapters ## Everything HTML | ||
htmlbook: $(OUTPUTDIRECTORY)/$(MAIN).html | ||
htmlchapters: $(CHAPTERS:%=$(OUTPUTDIRECTORY)/%.html) | ||
|
||
clean: html-clean | ||
html-clean: | ||
for f in $(addprefix $(OUTPUTDIRECTORY)/,$(MAIN) $(CHAPTERS)); do \ | ||
rm -f "$$f.html.json" ; \ | ||
done | ||
|
||
$(OUTPUTDIRECTORY)/%.html.json: %.pillar prepare | ||
./pillar export --to="HTML" --outputDirectory=$(OUTPUTDIRECTORY) --outputFile=$< $< | ||
|
||
$(OUTPUTDIRECTORY)/$(MAIN).html: TEMPLATE = $(HTMLTEMPLATE) | ||
$(CHAPTERS:%=$(OUTPUTDIRECTORY)/%.html): TEMPLATE = $(HTMLCHAPTERTEMPLATE) | ||
$(OUTPUTDIRECTORY)/%.html: $(OUTPUTDIRECTORY)/%.html.json $(TEMPLATE) | ||
./mustache --data=$< --template=$(TEMPLATE) > $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
$(call check_defined, LATEXTEMPLATE, Template for main document in PDF) | ||
$(call check_defined, LATEXCHAPTERTEMPLATE, Template for individual chapters in PDF) | ||
|
||
.phony: pdf pdfbook pdfchapters pdf-clean | ||
|
||
pdf: pdfbook pdfchapters ## Everything PDF | ||
pdfbook: $(OUTPUTDIRECTORY)/$(MAIN).pdf | ||
pdfchapters: $(CHAPTERS:%=$(OUTPUTDIRECTORY)/%.pdf) | ||
|
||
clean: pdf-clean | ||
pdf-clean: | ||
for f in $(addprefix $(OUTPUTDIRECTORY)/,$(MAIN) $(CHAPTERS)); do \ | ||
latexmk -cd -f -c "$$f" ; \ | ||
rm -f "$$f.tex" "$$f.tex.json" ; \ | ||
done | ||
|
||
$(OUTPUTDIRECTORY)/%.tex.json: %.pillar prepare | ||
./pillar export --to="LaTeX" --outputDirectory=$(OUTPUTDIRECTORY) --outputFile=$< $< | ||
|
||
$(OUTPUTDIRECTORY)/$(MAIN).tex: TEMPLATE = $(LATEXTEMPLATE) | ||
$(CHAPTERS:%=$(OUTPUTDIRECTORY)/%.tex): TEMPLATE = $(LATEXCHAPTERTEMPLATE) | ||
$(OUTPUTDIRECTORY)/%.tex: $(OUTPUTDIRECTORY)/%.tex.json $(TEMPLATE) | ||
./mustache --data=$< --template=$(TEMPLATE) > $@ | ||
|
||
$(OUTPUTDIRECTORY)/%.pdf: $(OUTPUTDIRECTORY)/%.tex | ||
latexmk -cd -use-make $< |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters