Skip to content

Commit

Permalink
style(packages): Compress whitespace in now-more-concise constructor …
Browse files Browse the repository at this point in the history
…functions
  • Loading branch information
alerque committed Jul 28, 2022
1 parent c467833 commit 5c77e59
Show file tree
Hide file tree
Showing 44 changed files with 0 additions and 168 deletions.
7 changes: 0 additions & 7 deletions packages/autodoc/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -100,30 +100,23 @@ local function typesetAST (options, content)
end

function package:_init (options)

base._init(self)

self.class:loadPackage("inputfilter")

if options then pl.tablex.update(theme, options) end

if not SILE.scratch.autodoc then
SILE.scratch.autodoc = {
theme = theme
}
end

end

function package.declareSettings (_)

SILE.settings:declare({
parameter = "autodoc.highlighting",
default = false,
type = "boolean",
help = "Whether audodoc enables syntax highlighting"
})

end

function package:registerCommands ()
Expand Down
3 changes: 0 additions & 3 deletions packages/background/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@ local outputBackground = function (color)
end

function package:_init ()

base._init(self)

self.class:loadPackage("color")

end

function package:registerCommands ()
Expand Down
3 changes: 0 additions & 3 deletions packages/balanced-frames/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,12 @@ local function buildPage (typesetter, independent)
end

function pack:_init (class)

base._init(self, class)

if not unbalanced_buildPage then
unbalanced_buildPage = SILE.typesetter.buildPage
SILE.typesetter.buildPage = buildPage
SILE.defaultTypesetter.buildPage = buildPage
end

end

function pack:registerCommands ()
Expand Down
6 changes: 0 additions & 6 deletions packages/bibtex/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,18 @@ local parseBibtex = function (fn)
end

function package:_init ()

base._init(self)

SILE.scratch.bibtex = { bib = {} }

Bibliography = require("packages.bibtex.bibliography")

end

function package.declareSettings (_)

SILE.settings:declare({
parameter = "bibtex.style",
type = "string",
default = "chicago",
help = "BibTeX style"
})

end

function package:registerCommands ()
Expand Down
4 changes: 0 additions & 4 deletions packages/bidi/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -249,17 +249,13 @@ function package:bidiDisableTypesetter (typesetter)
end

function package:_init ()

base._init(self)

self:deprecatedExport("reorder", self.reorder)
self:deprecatedExport("bidiEnableTypesetter", self.bidiEnableTypesetter)
self:deprecatedExport("bidiDisableTypesetter", self.bidiDisableTypesetter)

if SILE.typesetter then
self:bidiEnableTypesetter(SILE.typesetter)
end

self:bidiEnableTypesetter(SILE.defaultTypesetter)
end

Expand Down
5 changes: 0 additions & 5 deletions packages/boustrophedon/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ package._name = "boustrophedon"
local _swap

function package:_init (class)

base._init(self, class)

SILE.hyphenator.languages.grc = { patterns={} }

SILE.nodeMakers.grc = pl.class(SILE.nodeMakers.unicode)
function SILE.nodeMakers.grc.iterator (node, items)
return coroutine.wrap(function ()
Expand All @@ -22,13 +19,11 @@ function package:_init (class)
end
end)
end

_swap = SILE.nodefactory.vbox({})
_swap.outputYourself = function (_, typesetter, _)
typesetter.frame.direction = typesetter.frame.direction == "LTR-TTB" and "RTL-TTB" or "LTR-TTB"
typesetter.frame:newLine()
end

end

function package:registerCommands ()
Expand Down
3 changes: 0 additions & 3 deletions packages/break-firstfit/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,8 @@ local firstfit = function (typesetter, nl, breakWidth)
end

function package:_init ()

base._init(self)

SILE.typesetter._breakIntoLines_firstfit = firstfit

end

package.documentation = [[
Expand Down
4 changes: 0 additions & 4 deletions packages/chapterverse/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@ local package = pl.class(base)
package._name = "chapterverse"

function package:_init ()

base._init(self)

self.class:loadPackage("infonode")

if not SILE.scratch.chapterverse then
SILE.scratch.chapterverse = {}
end

end

function package:registerCommands ()
Expand Down
3 changes: 0 additions & 3 deletions packages/chordmode/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ local package = pl.class(base)
package._name = "chordmode"

function package:_init ()

base._init(self)

self.class:loadPackage("raiselower")
self.class:loadPackage("inputfilter")

end

function package.declareSettings (_)
Expand Down
1 change: 0 additions & 1 deletion packages/color-fonts/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ local package = pl.class(base)
package._name = "color-fonts"

function package:_init ()

base._init(self)

local harfbuzz = require("shapers.harfbuzz")
Expand Down
6 changes: 0 additions & 6 deletions packages/complex-spaces/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ local package = pl.class(base)
package._name = "complex-spaces"

function package:_init ()

base._init(self)

if not SILE.languageSupport.languages["x-spaces-are-nodes"] then
local xsan = pl.class(SILE.nodeMakers.unicode)
function xsan.makeGlue (node, item)
Expand All @@ -16,7 +14,6 @@ function package:_init ()
SILE.nodeMakers["x-spaces-are-nodes"] = xsan
SILE.languageSupport.languages["x-spaces-are-nodes"] = true
end

if SILE.shaper and not SILE.shaper.noncomplex_SpaceNode then
SILE.shaper.noncomplex_SpaceNode = SILE.shaper.makeSpaceNode
SILE.shaper.makeSpaceNode = function (_, options, item)
Expand All @@ -29,18 +26,15 @@ function package:_init ()
return SILE.shaper.noncomplex_SpaceNode(_, options, item)
end
end

end

function package.declareSettings (_)

SILE.settings:declare({
parameter = "shaper.complexspaces",
default = true,
type = "boolean",
help = "Whether the font's space glyph should be emitted, rather than a glue"
})

end

package.documentation = [[
Expand Down
6 changes: 0 additions & 6 deletions packages/converters/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,32 +70,26 @@ function package.checkConverters (_, source)
end

function package:_init ()

base._init(self)

if not SILE.scratch.converters then
SILE.scratch.converters = {}
end

extendCommand("include", function (options, content, original)
local result = self:checkConverters(options.src)
if not result then
options["src"] = result
original(options, content)
end
end)

extendCommand("img", function (options, content, original)
local result = self:checkConverters(options.src)
if not result then
options["src"] = result
original(options, content)
end
end)

self:deprecatedExport("register", self.register)
self:deprecatedExport("checkConverters", self.checkConverters)

end

function package:registerCommands ()
Expand Down
5 changes: 0 additions & 5 deletions packages/counters/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,14 @@ function package:formatMultilevelCounter (counter, options)
end

function package:_init ()

base._init(self)

if not SILE.scratch.counters then
SILE.scratch.counters = {}
end

self:export("getCounter", getCounter)
self:export("getMultilevelCounter", getMultilevelCounter)

self:deprecatedExport("formatCounter", self.formatCounter)
self:deprecatedExport("formatMultilevelCounter", self.formatMultilevelCounter)

end

function package:registerCommands ()
Expand Down
3 changes: 0 additions & 3 deletions packages/cropmarks/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,8 @@ local function reconstrainFrameset (fs)
end

function package:_init ()

base._init(self)

self.class:loadPackage("date")

end

function package:registerCommands ()
Expand Down
3 changes: 0 additions & 3 deletions packages/date/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ function package.date (_, options)
end

function package:_init ()

base._init(self)

self:deprecatedExport("date", self.date)

end

function package:registerCommands ()
Expand Down
3 changes: 0 additions & 3 deletions packages/dropcaps/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ local package = pl.class(base)
package._name = "dropcaps"

function package:_init ()

base._init(self)

self.class:loadPackage("rebox")
self.class:loadPackage("raiselower")

end

local shapeHbox = function (options, content)
Expand Down
3 changes: 0 additions & 3 deletions packages/folio/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,11 @@ function package:outputFolio (frame)
end

function package:_init (options)

base._init(self)

self.class:loadPackage("counters")
SILE.scratch.counters.folio = { value = 1, display = "arabic" }
self.class:registerHook("newpage", function() self:incrementFolio() end)
self.class:registerHook("endpage", function () self:outputFolio(options and options.frame) end)

self:export("outputFolio", self.outputFolio)
end

Expand Down
1 change: 0 additions & 1 deletion packages/font-fallback/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ local fallbackQueue = pl.class({
local activeFallbacks = {}

function package:_init ()

base._init(self)

local harfbuzz = require("shapers.harfbuzz")
Expand Down
4 changes: 0 additions & 4 deletions packages/footnotes/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ local package = pl.class(base)
package._name = "footnotes"

function package:_init (options)

base._init(self)

self.class:loadPackage("counters")
self.class:loadPackage("raiselower")
self.class:loadPackage("insertions")

if not SILE.scratch.counters.footnotes then
SILE.scratch.counters.footnote = { value = 1, display = "arabic" }
end

options = options or {}
self.class:initInsertionClass("footnote", {
insertInto = options.insertInto or "footnotes",
Expand Down
4 changes: 0 additions & 4 deletions packages/frametricks/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,9 @@ end


function package:_init ()

base._init(self)

self.class:loadPackage("balanced-frames")

self:export("breakFrameVertical", self.breakFrameVertical)

end

function package:registerCommands ()
Expand Down
3 changes: 0 additions & 3 deletions packages/grid/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,8 @@ end
local oldPageBuilder, oldLeadingFor, oldPushVglue, oldPushExplicitVglue

function package:_init ()

base._init(self)

gridSpacing = SILE.measurement()

end

function package:registerCommands ()
Expand Down
4 changes: 0 additions & 4 deletions packages/hanmenkyoshi/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,9 @@ local declareHanmenFrame = function (class, id, spec)
end

function package:_init ()

base._init(self)

self.class:loadPackage("tate")

self:export("declareHanmenFrame", declareHanmenFrame)

end

function package:registerCommands ()
Expand Down
Loading

0 comments on commit 5c77e59

Please sign in to comment.