Unverified Commit dc9b8d79 authored by Caleb Maclennan's avatar Caleb Maclennan
Browse files

Setup PDF and ODT output with proper languages

parent a3338dd1
......@@ -89,7 +89,12 @@ reports/progress.md: $(shell git ls-files -- '*.md') $(CCMTOOLKITDIR)/languages.
done
reports/%.pdf: reports/%.md
$(PANDOC) $< -t latex -o $@
$(PANDOC) \
--metadata lang=$(call lang4,$(LANGUAGE)) \
-t latex \
--pdf-engine=xelatex \
-V "mainfont:Libertinus Serif" \
$< -o $@
# Mostly this makefile will be used for exporting content to consumer formats,
# but for the English version importing from the legacy formats and munging
......@@ -117,3 +122,4 @@ endif # End export mode rules
parse_lesson = $(or $(filter $(LESSONS),$(subst -, ,$(basename $1))),)
parse_lessonfilter = $(or $(filter $(LESSONFILTERS),$(call unlocalize,$(subst -, ,$(basename $1)))),)
lang4 = $(shell echo -n $1-$${$${lang=$1}:u})
......@@ -5,7 +5,7 @@ all: course
FILTEREDLESSONS = $(call pattern_list,$(_lesson),$(LESSONS),$(call localize,$(LESSONFILTERS)),.md)
.PHONY: course
course: $(FILTEREDLESSONS)
course: $(addsuffix .pdf,$(basename $(FILTEREDLESSONS)))
$(FILTEREDLESSONS): %.md: $(LANGUAGE)/$(_lesson)-$$(call parse_lesson,$$@).md $(CCMTOOLKITDIR)/filter-$$(call parse_lessonfilter,$$@).lua $(CCMTOOLKITDIR)/filters-common.lua
$(PANDOC) $(PANDOCARGS) \
......@@ -17,8 +17,18 @@ $(FILTEREDLESSONS): %.md: $(LANGUAGE)/$(_lesson)-$$(call parse_lesson,$$@).md $(
# -M subtitle="Lesson Manuscript"
# -M subtitle="Study Guide"
%.odt: %.md $(MAKEFILE_LIST) $(wildcard $(CCMTOOLKITDIR/*.lua))
$(PANDOC) \
$(_lesson)-%.odt: $(_lesson)-%.md
$(PANDOC) $(PANDOCARGS) \
--standalone \
--metadata lang=$(call lang4,$(LANGUAGE)) \
--to odt \
$< -o $@
$(_lesson)-%.pdf: $(_lesson)-%.md
$(PANDOC) $(PANDOCARGS) \
--standalone \
--metadata lang=$(call lang4,$(LANGUAGE)) \
--to latex \
--pdf-engine=xelatex \
-V "mainfont:Libertinus Serif" \
$< -o $@
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment