Skip to content

Commit

Permalink
linux build support
Browse files Browse the repository at this point in the history
  • Loading branch information
true-grue committed Dec 15, 2021
1 parent 4c78c3e commit a03bc15
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ OPTIONS = -d default.yaml \
--lua-filter=filters/pagebreak.lua \
--lua-filter=filters/upper.lua

ifeq ($(OS),Windows_NT)
MKDIR_BUILD = if not exist build mkdir build
RM_BUILD = del /q build\*.*
else
MKDIR_BUILD = mkdir -p build
RM_BUILD = rm build/*.*
endif

all: html pdf docx

html: $(HTML_FILE)
Expand All @@ -31,14 +39,17 @@ pdf: $(PDF_FILE)
docx: $(DOCX_FILE)

$(HTML_FILE): $(MD_FILES)
$(MKDIR_BUILD)
pandoc $(MD_FILES) $(OPTIONS) --output=$(HTML_FILE) --to=html5 --mathjax --self-contained

$(PDF_FILE): $(MD_FILES)
$(MKDIR_BUILD)
pandoc $(MD_FILES) $(OPTIONS) --metadata-file pdf.yaml --output=$(PDF_FILE) --to=latex --pdf-engine=xelatex

$(DOCX_FILE): $(MD_FILES)
$(MKDIR_BUILD)
pandoc $(MD_FILES) $(OPTIONS) --reference-doc=template.docx --output=$(DOCX_FILE) --to=docx
python filters/bullets.py $(DOCX_FILE)

clean:
powershell rm build/*.*
$(RM_BUILD)

0 comments on commit a03bc15

Please sign in to comment.