-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (23 loc) · 1.17 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
.PHONY: phony help open open-html spellcheck
DOCUMENT := document
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
filter-test: ## Test filter
pandoc --defaults configs/test.yaml $(DOCUMENT).md
pdf: ## Make a PDF
pandoc --defaults configs/latex.yaml $(DOCUMENT).md -o build/$(DOCUMENT).pdf
pdf-no-filter: ## Make a PDF with no filters
pandoc --defaults configs/latex-no-filter.yaml $(DOCUMENT).md -o build/$(DOCUMENT).pdf
html: ## Make an HTML version of the document
pandoc --defaults configs/html.yaml $(DOCUMENT).md -o build/$(DOCUMENT).html
docx: ## Make a DOCX version of the document
pandoc --defaults configs/docx.yaml $(DOCUMENT).md -o build/$(DOCUMENT).docx
open: build/$(DOCUMENT).pdf ## Open PDF in default reader
xdg-open build/$(DOCUMENT).pdf
open-html: build/$(DOCUMENT).html ## Open HTML in default browswer
xdg-open build/$(DOCUMENT).html
spellcheck: ## Run a spellchecker (aspell)
if [ -e /usr/bin/aspell ]; then /usr/bin/aspell -c $(DOCUMENT).md; else echo "/usr/bin/aspell missing -- no spellcheck possible";fi
clean: ## Clean built artifacts
rm build/*