From 5c77e593202a2ae6119d139550f9b79071f82663 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Fri, 29 Jul 2022 01:07:05 +0300 Subject: [PATCH] style(packages): Compress whitespace in now-more-concise constructor functions --- packages/autodoc/init.lua | 7 ------- packages/background/init.lua | 3 --- packages/balanced-frames/init.lua | 3 --- packages/bibtex/init.lua | 6 ------ packages/bidi/init.lua | 4 ---- packages/boustrophedon/init.lua | 5 ----- packages/break-firstfit/init.lua | 3 --- packages/chapterverse/init.lua | 4 ---- packages/chordmode/init.lua | 3 --- packages/color-fonts/init.lua | 1 - packages/complex-spaces/init.lua | 6 ------ packages/converters/init.lua | 6 ------ packages/counters/init.lua | 5 ----- packages/cropmarks/init.lua | 3 --- packages/date/init.lua | 3 --- packages/dropcaps/init.lua | 3 --- packages/folio/init.lua | 3 --- packages/font-fallback/init.lua | 1 - packages/footnotes/init.lua | 4 ---- packages/frametricks/init.lua | 4 ---- packages/grid/init.lua | 3 --- packages/hanmenkyoshi/init.lua | 4 ---- packages/indexer/init.lua | 4 ---- packages/infonode/init.lua | 5 ----- packages/inputfilter/init.lua | 3 --- packages/insertions/init.lua | 3 --- packages/linespacing/init.lua | 3 --- packages/lists/init.lua | 3 --- packages/masters/init.lua | 5 ----- packages/math/init.lua | 3 --- packages/pagebuilder-bestfit/init.lua | 4 ---- packages/pandoc/init.lua | 3 --- packages/parallel/init.lua | 3 --- packages/pdf/init.lua | 4 ---- packages/pdfstructure/init.lua | 7 ------- packages/pullquote/init.lua | 3 --- packages/rotate/init.lua | 4 ---- packages/ruby/init.lua | 4 ---- packages/rules/init.lua | 3 --- packages/simpletable/init.lua | 1 - packages/tableofcontents/init.lua | 5 ----- packages/textcase/init.lua | 4 ---- packages/twoside/init.lua | 5 ----- packages/url/init.lua | 5 ----- 44 files changed, 168 deletions(-) diff --git a/packages/autodoc/init.lua b/packages/autodoc/init.lua index 84959f01a..7c825ec3a 100644 --- a/packages/autodoc/init.lua +++ b/packages/autodoc/init.lua @@ -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 () diff --git a/packages/background/init.lua b/packages/background/init.lua index 0414af6af..cdd1ef00d 100644 --- a/packages/background/init.lua +++ b/packages/background/init.lua @@ -12,11 +12,8 @@ local outputBackground = function (color) end function package:_init () - base._init(self) - self.class:loadPackage("color") - end function package:registerCommands () diff --git a/packages/balanced-frames/init.lua b/packages/balanced-frames/init.lua index 29ab7d0a3..d48de5aff 100644 --- a/packages/balanced-frames/init.lua +++ b/packages/balanced-frames/init.lua @@ -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 () diff --git a/packages/bibtex/init.lua b/packages/bibtex/init.lua index e35bd7310..5473146cf 100644 --- a/packages/bibtex/init.lua +++ b/packages/bibtex/init.lua @@ -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 () diff --git a/packages/bidi/init.lua b/packages/bidi/init.lua index 74ef48ede..6632b324e 100644 --- a/packages/bidi/init.lua +++ b/packages/bidi/init.lua @@ -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 diff --git a/packages/boustrophedon/init.lua b/packages/boustrophedon/init.lua index 71c5ef311..4788b6759 100644 --- a/packages/boustrophedon/init.lua +++ b/packages/boustrophedon/init.lua @@ -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 () @@ -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 () diff --git a/packages/break-firstfit/init.lua b/packages/break-firstfit/init.lua index 0bcffe06e..26871beb2 100644 --- a/packages/break-firstfit/init.lua +++ b/packages/break-firstfit/init.lua @@ -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 = [[ diff --git a/packages/chapterverse/init.lua b/packages/chapterverse/init.lua index c32eedec7..7638b7d78 100644 --- a/packages/chapterverse/init.lua +++ b/packages/chapterverse/init.lua @@ -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 () diff --git a/packages/chordmode/init.lua b/packages/chordmode/init.lua index 6996f6015..e23b0b1c8 100644 --- a/packages/chordmode/init.lua +++ b/packages/chordmode/init.lua @@ -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 (_) diff --git a/packages/color-fonts/init.lua b/packages/color-fonts/init.lua index fe5c01f23..f11d63630 100644 --- a/packages/color-fonts/init.lua +++ b/packages/color-fonts/init.lua @@ -4,7 +4,6 @@ local package = pl.class(base) package._name = "color-fonts" function package:_init () - base._init(self) local harfbuzz = require("shapers.harfbuzz") diff --git a/packages/complex-spaces/init.lua b/packages/complex-spaces/init.lua index 31b27fa77..81a4208ea 100644 --- a/packages/complex-spaces/init.lua +++ b/packages/complex-spaces/init.lua @@ -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) @@ -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) @@ -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 = [[ diff --git a/packages/converters/init.lua b/packages/converters/init.lua index 7ce08ee2f..15df29628 100644 --- a/packages/converters/init.lua +++ b/packages/converters/init.lua @@ -70,13 +70,10 @@ 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 @@ -84,7 +81,6 @@ function package:_init () original(options, content) end end) - extendCommand("img", function (options, content, original) local result = self:checkConverters(options.src) if not result then @@ -92,10 +88,8 @@ function package:_init () original(options, content) end end) - self:deprecatedExport("register", self.register) self:deprecatedExport("checkConverters", self.checkConverters) - end function package:registerCommands () diff --git a/packages/counters/init.lua b/packages/counters/init.lua index 3ba7bc3ca..fb19bc7dd 100644 --- a/packages/counters/init.lua +++ b/packages/counters/init.lua @@ -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 () diff --git a/packages/cropmarks/init.lua b/packages/cropmarks/init.lua index 17a246501..8db1b5c26 100644 --- a/packages/cropmarks/init.lua +++ b/packages/cropmarks/init.lua @@ -56,11 +56,8 @@ local function reconstrainFrameset (fs) end function package:_init () - base._init(self) - self.class:loadPackage("date") - end function package:registerCommands () diff --git a/packages/date/init.lua b/packages/date/init.lua index 70422bf94..b2819cc58 100644 --- a/packages/date/init.lua +++ b/packages/date/init.lua @@ -17,11 +17,8 @@ function package.date (_, options) end function package:_init () - base._init(self) - self:deprecatedExport("date", self.date) - end function package:registerCommands () diff --git a/packages/dropcaps/init.lua b/packages/dropcaps/init.lua index e9db4c9ff..f5cf5fede 100644 --- a/packages/dropcaps/init.lua +++ b/packages/dropcaps/init.lua @@ -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) diff --git a/packages/folio/init.lua b/packages/folio/init.lua index e8b055c11..0e6b3b015 100644 --- a/packages/folio/init.lua +++ b/packages/folio/init.lua @@ -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 diff --git a/packages/font-fallback/init.lua b/packages/font-fallback/init.lua index 370005e58..bfb0f7a3a 100644 --- a/packages/font-fallback/init.lua +++ b/packages/font-fallback/init.lua @@ -81,7 +81,6 @@ local fallbackQueue = pl.class({ local activeFallbacks = {} function package:_init () - base._init(self) local harfbuzz = require("shapers.harfbuzz") diff --git a/packages/footnotes/init.lua b/packages/footnotes/init.lua index a0a922cdd..1bbfea059 100644 --- a/packages/footnotes/init.lua +++ b/packages/footnotes/init.lua @@ -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", diff --git a/packages/frametricks/init.lua b/packages/frametricks/init.lua index 8bedd2299..ceeef2782 100644 --- a/packages/frametricks/init.lua +++ b/packages/frametricks/init.lua @@ -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 () diff --git a/packages/grid/init.lua b/packages/grid/init.lua index d2aabd525..d72ff48d4 100644 --- a/packages/grid/init.lua +++ b/packages/grid/init.lua @@ -140,11 +140,8 @@ end local oldPageBuilder, oldLeadingFor, oldPushVglue, oldPushExplicitVglue function package:_init () - base._init(self) - gridSpacing = SILE.measurement() - end function package:registerCommands () diff --git a/packages/hanmenkyoshi/init.lua b/packages/hanmenkyoshi/init.lua index b7bbc16cf..2247ba971 100644 --- a/packages/hanmenkyoshi/init.lua +++ b/packages/hanmenkyoshi/init.lua @@ -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 () diff --git a/packages/indexer/init.lua b/packages/indexer/init.lua index 611532b4f..029163cd8 100644 --- a/packages/indexer/init.lua +++ b/packages/indexer/init.lua @@ -26,15 +26,11 @@ end -- end function package:_init () - base._init(self) - if not SILE.scratch.index then SILE.scratch.index = {} end - self:deprecatedExport("buildIndex", buildIndex) - end function package:registerCommands () diff --git a/packages/infonode/init.lua b/packages/infonode/init.lua index 1be450254..c33732726 100644 --- a/packages/infonode/init.lua +++ b/packages/infonode/init.lua @@ -42,20 +42,15 @@ local _deprecate = [[ ]] function package:_init () - base._init(self) - if not SILE.scratch.info then SILE.scratch.info = { thispage = {} } end - self.class:registerHook("newpage", newPageInfo) - self:deprecatedExport("newPageInfo", function (class) SU.deprecated("class:newPageInfo", nil, "0.13.0", "0.15.0", _deprecate) return class:newPageInfo() end) - end function package:registerCommands () diff --git a/packages/inputfilter/init.lua b/packages/inputfilter/init.lua index a6a4c9a76..57cbfbd7e 100644 --- a/packages/inputfilter/init.lua +++ b/packages/inputfilter/init.lua @@ -36,12 +36,9 @@ function package.createCommand (_, pos, col, line, command, options, content) end function package:_init () - base._init(self) - self:deprecatedExport("createCommand", self.createCommand) self:deprecatedExport("transformContent", self.transformContent) - end package.documentation = [[ diff --git a/packages/insertions/init.lua b/packages/insertions/init.lua index 12a0abe39..7751a5177 100644 --- a/packages/insertions/init.lua +++ b/packages/insertions/init.lua @@ -220,13 +220,10 @@ local insert = function (_, classname, vbox) end function package:_init () - base._init(self) - if not SILE.scratch.insertions then SILE.scratch.insertions = { classes = {} } end - if not SILE.insertions then SILE.insertions = {} end diff --git a/packages/linespacing/init.lua b/packages/linespacing/init.lua index 330c39be4..172aaeb5d 100644 --- a/packages/linespacing/init.lua +++ b/packages/linespacing/init.lua @@ -93,11 +93,8 @@ local linespacingLeading = function (_, vbox, previous) end function package:_init () - base._init(self) - SILE.typesetter.leadingFor = linespacingLeading - end function package.declareSettings (_) diff --git a/packages/lists/init.lua b/packages/lists/init.lua index 82511f0ee..8f0a4461d 100644 --- a/packages/lists/init.lua +++ b/packages/lists/init.lua @@ -208,11 +208,8 @@ local doNestedList = function (_, listType, options, content) end function package:_init () - base._init(self) - self.class:loadPackage("counters") - end function package.declareSettings (_) diff --git a/packages/masters/init.lua b/packages/masters/init.lua index b366d5647..333640961 100644 --- a/packages/masters/init.lua +++ b/packages/masters/init.lua @@ -71,23 +71,18 @@ local function currentMaster (_) end function package:_init (options) - base._init(self, options) - if not SILE.scratch.masters then SILE.scratch.masters = {} end - self:export("switchMasterOnePage", switchMasterOnePage) self:export("switchMaster", switchMaster) self:export("defineMaster", defineMaster) self:export("defineMasters", defineMasters) self:export("currentMaster", currentMaster) - if options then self.class:defineMasters(options) end - end function package:registerCommands () diff --git a/packages/math/init.lua b/packages/math/init.lua index 458f3f079..5844567c4 100644 --- a/packages/math/init.lua +++ b/packages/math/init.lua @@ -4,12 +4,9 @@ local package = pl.class(base) package._name = "math" function package:_init () - base._init(self) - self.class:loadPackage("math.typesetter") self.class:loadPackage("math.texlike") - end function package.declareSettings (_) diff --git a/packages/pagebuilder-bestfit/init.lua b/packages/pagebuilder-bestfit/init.lua index a0844884b..7819065dc 100644 --- a/packages/pagebuilder-bestfit/init.lua +++ b/packages/pagebuilder-bestfit/init.lua @@ -6,9 +6,7 @@ package._name = "pagebuilder-bestfit" local MAX_PAGES = 5 function package:_init () - base._init(self) - SILE.typesetter.buildPage = function (typesetter, independent) -- Find last penalty local q = typesetter.state.outputQueue @@ -38,13 +36,11 @@ function package:_init () typesetter:outputLinesToPage(slice) typesetter.state.outputQueue = newslice if #(typesetter.state.outputQueue) == 0 then return false end - typesetter:initNextFrame() -- This causes a tail call if there is more stuff waiting -- If not, we keep going if we are being asked to ship out a page now now now. until lastpenalty > -10000 return false -- because we have already dealt with initializing the next frame end - end package.documentation = [[ diff --git a/packages/pandoc/init.lua b/packages/pandoc/init.lua index b462a6123..b43f13e38 100644 --- a/packages/pandoc/init.lua +++ b/packages/pandoc/init.lua @@ -46,9 +46,7 @@ local handlePandocArgs = function (options) end function package:_init () - base._init(self) - self.class:loadPackage("footnotes") self.class:loadPackage("image") self.class:loadPackage("pdf") @@ -56,7 +54,6 @@ function package:_init () self.class:loadPackage("rules") self.class:loadPackage("url") self.class:loadPackage("verbatim") - end function package:registerCommands () diff --git a/packages/parallel/init.lua b/packages/parallel/init.lua index 24e66fb48..b26fa9850 100644 --- a/packages/parallel/init.lua +++ b/packages/parallel/init.lua @@ -61,9 +61,7 @@ local addBalancingGlue = function (height) end function package:_init (options) - base._init(self, options) - SILE.typesetter = nulTypesetter(SILE.getFrame("page")) for frame, typesetter in pairs(options.frames) do typesetterPool[frame] = SILE.defaultTypesetter(SILE.getFrame(typesetter)) @@ -101,7 +99,6 @@ function package:_init (options) parallelPagebreak() oldfinish(self_) end - end function package:registerCommands () diff --git a/packages/pdf/init.lua b/packages/pdf/init.lua index bb27dd73d..1b1fe473a 100644 --- a/packages/pdf/init.lua +++ b/packages/pdf/init.lua @@ -25,15 +25,11 @@ local function validate_date (date) end function package:_init () - base._init(self) - pdf = require("justenoughlibtexpdf") - if SILE.outputter._name ~= "libtexpdf" then SU.error("pdf package requires libtexpdf backend") end - end function package:registerCommands () diff --git a/packages/pdfstructure/init.lua b/packages/pdfstructure/init.lua index 198939ee1..5e7c5420b 100644 --- a/packages/pdfstructure/init.lua +++ b/packages/pdfstructure/init.lua @@ -69,22 +69,16 @@ local function dumpTree (node) end function package:_init () - base._init(self) - pdf = require("justenoughlibtexpdf") - local _typeset = SILE.typesetter.typeset SILE.typesetter.typeset = function (node, text) actualtext[#actualtext] = tostring(actualtext[#actualtext]) .. text _typeset(node, text) end - local stRoot = stNode("Document") stPointer = stRoot - self.class:loadPackage("pdf") - function SILE.outputters.libtexpdf._endHook (_) local catalog = pdf.get_dictionary("Catalog") local structureTree = pdf.parse("<< /Type /StructTreeRoot >>") @@ -95,7 +89,6 @@ function package:_init () if structureNumberTree then pdf.release(structureNumberTree) end if structureTree then pdf.release(structureTree) end end - end function package:registerCommands () diff --git a/packages/pullquote/init.lua b/packages/pullquote/init.lua index 39af9253a..ae6e6ba3a 100644 --- a/packages/pullquote/init.lua +++ b/packages/pullquote/init.lua @@ -26,13 +26,10 @@ local typesetMark = function (open, setback, scale, color, mark) end function package:_init () - base._init(self) - self.class:loadPackage("color") self.class:loadPackage("raiselower") self.class:loadPackage("rebox") - end function package:registerCommands () diff --git a/packages/rotate/init.lua b/packages/rotate/init.lua index e79339cb0..123ce99e7 100644 --- a/packages/rotate/init.lua +++ b/packages/rotate/init.lua @@ -53,17 +53,13 @@ local outputRotatedHbox = function (self, typesetter, line) end function package:_init () - base._init(self) - if SILE.typesetter.frame then enter(SILE.typesetter.frame, SILE.typesetter) table.insert(SILE.typesetter.frame.leaveHooks, leave) end - table.insert(SILE.framePrototype.enterHooks, enter) table.insert(SILE.framePrototype.leaveHooks, leave) - end function package:registerCommands () diff --git a/packages/ruby/init.lua b/packages/ruby/init.lua index 11c0dc172..e1ff0a55f 100644 --- a/packages/ruby/init.lua +++ b/packages/ruby/init.lua @@ -28,15 +28,11 @@ local checkIfSpacerNeeded = function (reading) end function package:_init () - base._init(self) - -- Japaneese language support defines units which are useful here self.class:loadPackage("font-fallback") SILE.call("font:add-fallback", { family = "Noto Sans CJK JP" }) - SILE.languageSupport.loadLanguage("ja") - end function package.declareSettings (_) diff --git a/packages/rules/init.lua b/packages/rules/init.lua index 9f6ce7ee4..0fa5a48b0 100644 --- a/packages/rules/init.lua +++ b/packages/rules/init.lua @@ -43,12 +43,9 @@ function hrulefillglue:outputYourself (typesetter, line) end function package:_init () - base._init(self) - self.class:loadPackage("raiselower") self.class:loadPackage("rebox") - end function package:registerCommands () diff --git a/packages/simpletable/init.lua b/packages/simpletable/init.lua index 13ef96c91..8bf773278 100644 --- a/packages/simpletable/init.lua +++ b/packages/simpletable/init.lua @@ -6,7 +6,6 @@ package._name = "simpletable" local tableTag, trTag, tdTag function package:_init (options) - base._init(self, options) if not SILE.scratch.simpletable then diff --git a/packages/tableofcontents/init.lua b/packages/tableofcontents/init.lua index 9a523658a..2ea3808d7 100644 --- a/packages/tableofcontents/init.lua +++ b/packages/tableofcontents/init.lua @@ -70,19 +70,14 @@ if not SILE.scratch.pdf_destination_counter then end function package:_init () - base._init(self) - if not SILE.scratch.tableofcontents then SILE.scratch.tableofcontents = {} end - self.class:loadPackage("infonode") self.class:loadPackage("leaders") - self.class:registerHook("endpage", _moveTocNodes) self.class:registerHook("finish", _writeToc) - self:deprecatedExport("writeToc", _writeToc) self:deprecatedExport("moveTocNodes", _moveTocNodes) end diff --git a/packages/textcase/init.lua b/packages/textcase/init.lua index e8c603713..1386528bf 100644 --- a/packages/textcase/init.lua +++ b/packages/textcase/init.lua @@ -36,15 +36,11 @@ local titlecase = function (class, input, extraArgs) end function package:_init () - base._init(self) - self.class:loadPackage("inputfilter") - self:deprecatedExport("uppercase", uppercase) self:deprecatedExport("lowercase", lowercase) self:deprecatedExport("titlecase", titlecase) - end function package:registerCommands () diff --git a/packages/twoside/init.lua b/packages/twoside/init.lua index 2d56fb4cb..b44b557d0 100644 --- a/packages/twoside/init.lua +++ b/packages/twoside/init.lua @@ -50,27 +50,22 @@ local _deprecate = [[ ]] function package:_init (options) - base._init(self) - if not SILE.scratch.masters then SU.error("Cannot load twoside package before masters.") end - self:export("oddPage", oddPage) self:export("mirrorMaster", mirrorMaster) self:export("switchPage", function (class) SU.deprecated("class:switchPage", nil, "0.13.0", "0.15.0", _deprecate) return class:switchPage() end) - self.class.oddPageMaster = options.oddPageMaster self.class.evenPageMaster = options.evenPageMaster self.class:registerPostinit(function (class) class:mirrorMaster(options.oddPageMaster, options.evenPageMaster) end) self.class:registerHook("newpage", switchPage) - end function package:registerCommands () diff --git a/packages/url/init.lua b/packages/url/init.lua index 8726cebda..76a86a9d4 100644 --- a/packages/url/init.lua +++ b/packages/url/init.lua @@ -20,16 +20,11 @@ end local breakPattern = "["..escapeRegExpMinimal(preferBreakBefore..preferBreakAfter..alwaysBreakAfter).."]" function package:_init () - base._init(self) - self.class:loadPackage("verbatim") self.class:loadPackage("inputfilter") - pdf = SILE.outputter == SILE.outputters.libtexpdf - if pdf then self.class:loadPackage("pdf") end - end function package.declareSettings (_)