Skip to content

Commit

Permalink
feat(templates): Pass edit option to SIL template for use by document…
Browse files Browse the repository at this point in the history
… class
  • Loading branch information
alerque committed Mar 2, 2023
1 parent 978ffd8 commit c7db40c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions classes/cabook.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ end

function class:declareOptions ()
book.declareOptions(self)
local binding, crop, edition, background, verseindex, layout
local binding, crop, edition, edit, background, verseindex, layout
self:declareOption("binding", function (_, value)
if value then binding = value end
return binding
Expand All @@ -81,6 +81,10 @@ function class:declareOptions ()
if value then edition = value end
return edition
end)
self:declareOption("edit", function (_, value)
if value then edit = value end
return edit
end)
self:declareOption("background", function (_, value)
if value then background = SU.cast("boolean", value) end
return background
Expand All @@ -100,7 +104,6 @@ end

function class:setOptions (options)
options.binding = options.binding or "print" -- print, paperback, hardcover, coil, stapled
options.edition = options.edition
options.crop = options.crop or (options.binding ~= "print")
options.background = options.background or true
options.verseindex = options.verseindex or false
Expand Down
1 change: 1 addition & 0 deletions rules/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ DOCUMENTCLASS ?= cabook
DOCUMENTOPTIONS += binding=$(call unlocalize,$(or $(call parse_binding,$@),$(firstword $(BINDINGS))))
DOCUMENTOPTIONS += layout=$(call unlocalize,$(or $(call parse_papersize,$@),$(firstword $(PAPERSIZES))))
DOCUMENTOPTIONS += $(and $(call parse_editions,$@),edition=$(call unlocalize,$(call parse_editions,$@)))
DOCUMENTOPTIONS += $(and $(call parse_edits,$@),edit=$(call unlocalize,$(call parse_edits,$@)))

# Default template for setting up Gitlab CI runners
CITEMPLATE ?= $(CASILEDIR)/travis.yml
Expand Down

0 comments on commit c7db40c

Please sign in to comment.