Skip to content

Commit

Permalink
fixup! [NFY] refactor(classes)!: Convert class inheritance from stdli…
Browse files Browse the repository at this point in the history
…b to Penlight
  • Loading branch information
alerque committed Sep 23, 2020
1 parent 9f23a1d commit 9846498
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 40 deletions.
1 change: 0 additions & 1 deletion classes/base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ local base = pl.class({
for _, v in pairs(SILE.frames) do SILE.outputter:debugFrame(v) end
end
end)
-- return self:initialFrame()
end,

declareOption = function (self, option, setter)
Expand Down
75 changes: 37 additions & 38 deletions classes/plain.lua
Original file line number Diff line number Diff line change
Expand Up @@ -186,44 +186,43 @@ local _oldplain = {
end
}

local plain = pl.class(SILE.classes.base, {

defaultFrameset = {
content = {
left = "5%pw",
right = "95%pw",
top = "5%ph",
bottom = "90%ph"
},
folio = {
left = "5%pw",
right = "95%pw",
top = "92%ph",
bottom = "97%ph"
}
},
firstContentFrame = "content",

_init = function (self, options)
SILE.require("packages/bidi")
self:declareOption("direction", function (value)
self.defaultFrameset.content.direction = value
return value
end)
self:super(options)
self:loadPackage("folio")
end,

registerCommands = function (self)
self:super()
_oldplain.registerCommands()
end,

endPage = function (self)
self:outputFolio()
self:super()
end
})
local plain = pl.class(SILE.classes.base)

plain.defaultFrameset = {
content = {
left = "5%pw",
right = "95%pw",
top = "5%ph",
bottom = "90%ph"
},
folio = {
left = "5%pw",
right = "95%pw",
top = "92%ph",
bottom = "97%ph"
}
}
plain.firstContentFrame = "content"

function plain:_init (options)
SILE.require("packages/bidi")
self:declareOption("direction", function (value)
self.defaultFrameset.content.direction = value
return value
end)
self:super(options)
self:loadPackage("folio")
end

function plain:registerCommands ()
self._base.registerCommands()
_oldplain.registerCommands()
end

function plain:endPage ()
self:outputFolio()
self._base.endPage(self)
end

SILE.classes.plain = plain
return plain
2 changes: 1 addition & 1 deletion core/inputs-common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ SILE.inputs.common = {
SILE.outputFilename = "/dev/stdout"
end
end
local ff = SILE.documentState.documentClass:init()
local ff = SILE.documentState.documentClass:initialFrame()
SILE.typesetter:init(ff)
end
}
Expand Down

0 comments on commit 9846498

Please sign in to comment.