Skip to content

Commit

Permalink
style(classes): Sanitize Lua formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Mar 31, 2023
1 parent 17da684 commit 0e0aec7
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 9 deletions.
31 changes: 27 additions & 4 deletions classes/diglot.lua
Expand Up @@ -6,13 +6,36 @@ class._name = "diglot"
function class:_init (options)
plain._init(self, options)
self:loadPackage("counters")

self:registerPostinit(function ()
SILE.scratch.counters.folio = { value = 1, display = "arabic" }
end)
self:declareFrame("a", { left = "8.3%pw", right = "48%pw", top = "11.6%ph", bottom = "80%ph" })
self:declareFrame("b", { left = "52%pw", right = "100%pw-left(a)", top = "top(a)", bottom = "bottom(a)" })
self:declareFrame("folio",{ left = "left(a)", right = "right(b)", top = "bottom(a)+3%ph", bottom = "bottom(a)+8%ph" })
self:loadPackage("parallel", { frames = { left = "a", right = "b" } })

self:declareFrame("a", {
left = "8.3%pw",
right = "48%pw",
top = "11.6%ph",
bottom = "80%ph"
})
self:declareFrame("b", {
left = "52%pw",
right = "100%pw-left(a)",
top = "top(a)",
bottom = "bottom(a)"
})
self:declareFrame("folio", {
left = "left(a)",
right = "right(b)",
top = "bottom(a)+3%ph",
bottom = "bottom(a)+8%ph"
})
self:loadPackage("parallel", {
frames = {
left = "a",
right = "b"
}
})

end

return class
40 changes: 35 additions & 5 deletions classes/triglot.lua
Expand Up @@ -6,16 +6,46 @@ class._name = "triglot"
function class:_init (options)
book._init(self, options)
self:loadPackage("counters")

self:registerPostinit(function ()
SILE.scratch.counters.folio = { value = 1, display = "arabic" }
end)
self:declareFrame("a", {left = "5%pw", right = "28%pw", top = "11.6%ph", bottom = "80%ph" })
self:declareFrame("b", {left = "33%pw", right = "60%pw", top = "top(a)", bottom = "bottom(a)" })
self:declareFrame("c", {left = "66%pw", right = "95%pw", top = "top(a)", bottom = "bottom(a)" })
self:declareFrame("folio",{left = "left(a)", right = "right(b)", top = "bottom(a)+3%pw",bottom = "bottom(a)+8%ph" })
self:loadPackage("parallel", { frames = { left = "a", middle = "b", right= "c" } })

self:declareFrame("a", {
left = "5%pw",
right = "28%pw",
top = "11.6%ph",
bottom = "80%ph"
})
self:declareFrame("b", {
left = "33%pw",
right = "60%pw",
top = "top(a)",
bottom = "bottom(a)"
})
self:declareFrame("c", {
left = "66%pw",
right = "95%pw",
top = "top(a)",
bottom = "bottom(a)"
})
self:declareFrame("folio", {
left = "left(a)",
right = "right(b)",
top = "bottom(a)+3%pw",
bottom = "bottom(a)+8%ph"
})
self:loadPackage("parallel", {
frames = {
left = "a",
middle = "b",
right= "c"
}
})

SILE.settings:set("linebreak.tolerance", 5000)
SILE.settings:set("document.parindent", SILE.nodefactory.glue())

end

return class

0 comments on commit 0e0aec7

Please sign in to comment.