Skip to content

Commit

Permalink
style: Reformat Lua with stylua
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Jun 11, 2024
1 parent acdef4e commit cae4b31
Show file tree
Hide file tree
Showing 7 changed files with 220 additions and 226 deletions.
54 changes: 27 additions & 27 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
std = "lua54"
include_files = {
"**/*.lua",
"*.rockspec",
".busted",
".luacheckrc"
"**/*.lua",
"*.rockspec",
".busted",
".luacheckrc",
}
exclude_files = {
"casile-*",
"lua_modules",
"lua-libraries",
".lua",
".luarocks",
".install"
"casile-*",
"lua_modules",
"lua-libraries",
".lua",
".luarocks",
".install",
}
files["spec"] = {
std = "+busted"
std = "+busted",
}
files["pandoc-filters"] = {
globals = {
"Block",
"Header",
"Inline",
"Link",
"Note",
"Pandoc",
"pandoc"
},
ignore = { "4.2" }
globals = {
"Block",
"Header",
"Inline",
"Link",
"Note",
"Pandoc",
"pandoc",
},
ignore = { "4.2" },
}
globals = {
"SILE",
"SU",
"luautf8",
"pl",
"fluent",
"CASILE"
"SILE",
"SU",
"luautf8",
"pl",
"fluent",
"CASILE",
}
max_line_length = false
61 changes: 29 additions & 32 deletions layouts/ekran.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,38 @@ return function (class)
class.options.papersize = 1920 / 192 .. "in x " .. 1080 / 192 .. "in"

if class._name == "cabook" then
class:loadPackage(
"masters",
class:loadPackage("masters", {
{
{
id = "right",
firstContentFrame = "content",
frames = {
page = {
left = "0",
right = "100%pw",
top = "0",
bottom = "100%ph",
},
content = {
left = "10%pw",
right = "100%pw-10%pw",
top = "bottom(runningHead)+1%ph",
bottom = "top(footnotes)-1%ph",
},
runningHead = {
left = "left(content)",
right = "right(content)",
top = "2%ph",
bottom = "10%ph",
},
footnotes = {
left = "left(content)",
right = "right(content)",
height = "0",
bottom = "100%ph-3%ph",
},
id = "right",
firstContentFrame = "content",
frames = {
page = {
left = "0",
right = "100%pw",
top = "0",
bottom = "100%ph",
},
content = {
left = "10%pw",
right = "100%pw-10%pw",
top = "bottom(runningHead)+1%ph",
bottom = "top(footnotes)-1%ph",
},
runningHead = {
left = "left(content)",
right = "right(content)",
top = "2%ph",
bottom = "10%ph",
},
footnotes = {
left = "left(content)",
right = "right(content)",
height = "0",
bottom = "100%ph-3%ph",
},
},
}
)
},
})

class:registerCommand("output-right-running-head", function (_, _)
if not SILE.scratch.headers.right then
Expand Down
49 changes: 23 additions & 26 deletions layouts/halfletter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,31 @@ return function (class)
class.options.papersize = "halfletter"

if class._name == "cabook" then
class:loadPackage(
"masters",
class:loadPackage("masters", {
{
{
id = "right",
firstContentFrame = "content",
frames = {
content = {
left = "left(page) + 22.5mm",
right = "right(page) - 15mm",
top = "top(page) + 20mm",
bottom = "top(footnotes)",
},
runningHead = {
left = "left(content)",
right = "right(content)",
top = "top(content) - 8mm",
bottom = "top(content)",
},
footnotes = {
left = "left(content)",
right = "right(content)",
height = "0",
bottom = "bottom(page) - 15mm",
},
id = "right",
firstContentFrame = "content",
frames = {
content = {
left = "left(page) + 22.5mm",
right = "right(page) - 15mm",
top = "top(page) + 20mm",
bottom = "top(footnotes)",
},
runningHead = {
left = "left(content)",
right = "right(content)",
top = "top(content) - 8mm",
bottom = "top(content)",
},
footnotes = {
left = "left(content)",
right = "right(content)",
height = "0",
bottom = "bottom(page) - 15mm",
},
},
}
)
},
})
end
end
49 changes: 23 additions & 26 deletions layouts/octavo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,31 @@ return function (class)
class.options.papersize = "432pt x 648pt"

if class._name == "cabook" then
class:loadPackage(
"masters",
class:loadPackage("masters", {
{
{
id = "right",
firstContentFrame = "content",
frames = {
content = {
left = "left(page) + 22.5mm",
right = "right(page) - 15mm",
top = "top(page) + 20mm",
bottom = "top(footnotes)",
},
runningHead = {
left = "left(content)",
right = "right(content)",
top = "top(content) - 8mm",
bottom = "top(content) - 2mm",
},
footnotes = {
left = "left(content)",
right = "right(content)",
height = "0",
bottom = "bottom(page) - 15mm",
},
id = "right",
firstContentFrame = "content",
frames = {
content = {
left = "left(page) + 22.5mm",
right = "right(page) - 15mm",
top = "top(page) + 20mm",
bottom = "top(footnotes)",
},
runningHead = {
left = "left(content)",
right = "right(content)",
top = "top(content) - 8mm",
bottom = "top(content) - 2mm",
},
footnotes = {
left = "left(content)",
right = "right(content)",
height = "0",
bottom = "bottom(page) - 15mm",
},
},
}
)
},
})
end
end
61 changes: 29 additions & 32 deletions layouts/royaloctavo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,37 @@ return function (class)
class.options.papersize = "165mm x 250mm"

if class._name == "cabook" then
class:loadPackage(
"masters",
class:loadPackage("masters", {
{
{
id = "right",
firstContentFrame = "content",
frames = {
content = {
left = "left(page) + 22.5mm",
right = "right(page) - 15mm",
top = "22mm",
bottom = "top(footnotes)",
},
runningHead = {
left = "left(content)",
right = "right(content)",
top = "top(content) - 10mm",
bottom = "top(content) - 4mm",
},
footnotes = {
left = "left(content)",
right = "right(content)",
height = "0",
bottom = "top(folio) - 5mm",
},
folio = {
left = "left(content)",
right = "right(content)",
height = "5mm",
bottom = "bottom(page) - 12.5mm",
},
id = "right",
firstContentFrame = "content",
frames = {
content = {
left = "left(page) + 22.5mm",
right = "right(page) - 15mm",
top = "22mm",
bottom = "top(footnotes)",
},
runningHead = {
left = "left(content)",
right = "right(content)",
top = "top(content) - 10mm",
bottom = "top(content) - 4mm",
},
footnotes = {
left = "left(content)",
right = "right(content)",
height = "0",
bottom = "top(folio) - 5mm",
},
folio = {
left = "left(content)",
right = "right(content)",
height = "5mm",
bottom = "bottom(page) - 12.5mm",
},
},
}
)
},
})
end
end
Loading

0 comments on commit cae4b31

Please sign in to comment.