• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sile-typesetter / sile / 10881107806

16 Sep 2024 09:29AM UTC coverage: 61.663% (-7.2%) from 68.912%
10881107806

push

github

web-flow
chore(deps): Bump DeterminateSystems/nix-installer-action from 13 to 14 (#2110)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

10751 of 17435 relevant lines covered (61.66%)

2338.25 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/typesetters/grid.lua
1
local base = require("typesetters.base")
×
2

3
local typesetter = pl.class(base)
×
4
typesetter._name = "grid"
×
5

6
local function makeUp (spacing, totals)
7
   local toadd = (spacing - SILE.types.measurement(totals.gridCursor)) % spacing
×
8
   totals.gridCursor = totals.gridCursor + toadd
×
9
   SU.debug("typesetter", "Makeup height =", toadd)
×
10
   return SILE.types.node.vglue({ discardable = false, gridleading = true, height = toadd })
×
11
end
12

13
function typesetter:_init (frame)
×
14
   base._init(self, frame)
×
15
   self.options = { spacing = SILE.types.measurement("1bs") }
×
16
end
17

18
function typesetter:leadingFor (vbox, previous)
×
19
   SU.debug("typesetter", "   Considering leading between two lines (grid mode):")
×
20
   SU.debug("typesetter", "   1)", previous)
×
21
   SU.debug("typesetter", "   2)", vbox)
×
22
   if not previous then
×
23
      return SILE.types.node.vglue()
×
24
   end
25
   SU.debug("typesetter", "   Depth of previous line was", previous.depth)
×
26
   local totals = self.frame.state.totals
×
27
   local oldCursor = SILE.types.measurement(totals.gridCursor)
×
28
   totals.gridCursor = oldCursor + vbox.height:absolute() + previous.depth
×
29
   SU.debug("typesetter", "   Cursor change =", totals.gridCursor - oldCursor)
×
30
   return makeUp(self.options.spacing, self.frame.state.totals)
×
31
end
32

33
function typesetter:pushVglue (spec)
×
34
   -- if SU.type(spec) ~= "table" then SU.warn("Please use pushVertical() to pass a premade node instead of a spec") end
35
   local node = SU.type(spec) == "vglue" and spec or SILE.types.node.vglue(spec)
×
36
   node.height.stretch = SILE.types.measurement()
×
37
   node.height.shrink = SILE.types.measurement()
×
38
   local totals = self.frame.state.totals
×
39
   totals.gridCursor = totals.gridCursor + SILE.types.measurement(node.height):absolute()
×
40
   self:pushVertical(node)
×
41
   self:pushVertical(makeUp(self.options.spacing, self.frame.state.totals))
×
42
   return node
×
43
end
44

45
function typesetter:pushExplicitVglue (spec)
×
46
   -- if SU.type(spec) ~= "table" then SU.warn("Please use pushVertical() to pass a premade node instead of a spec") end
47
   local node = SU.type(spec) == "vglue" and spec or SILE.types.node.vglue(spec)
×
48
   node.explicit = true
×
49
   node.discardable = false
×
50
   node.height.stretch = SILE.types.measurement()
×
51
   node.height.shrink = SILE.types.measurement()
×
52
   local totals = self.frame.state.totals
×
53
   totals.gridCursor = totals.gridCursor + SILE.types.measurement(node.height):absolute()
×
54
   self:pushVertical(node)
×
55
   self:pushVertical(makeUp(self.options.spacing, self.frame.state.totals))
×
56
   return node
×
57
end
58

59
return typesetter
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc