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

sile-typesetter / sile / 9507147410

13 Jun 2024 09:40PM UTC coverage: 50.521% (-18.7%) from 69.177%
9507147410

push

github

web-flow
Merge pull request #2062 from alerque/plug-fluent-leak

Link document.language setting more closely with Fluent locale

15 of 15 new or added lines in 3 files covered. (100.0%)

3244 existing lines in 65 files now uncovered.

8586 of 16995 relevant lines covered (50.52%)

4659.09 hits per line

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

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

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

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

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

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

UNCOV
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
UNCOV
35
   local node = SU.type(spec) == "vglue" and spec or SILE.types.node.vglue(spec)
×
UNCOV
36
   node.height.stretch = SILE.types.measurement()
×
UNCOV
37
   node.height.shrink = SILE.types.measurement()
×
UNCOV
38
   local totals = self.frame.state.totals
×
UNCOV
39
   totals.gridCursor = totals.gridCursor + SILE.types.measurement(node.height):absolute()
×
UNCOV
40
   self:pushVertical(node)
×
UNCOV
41
   self:pushVertical(makeUp(self.options.spacing, self.frame.state.totals))
×
UNCOV
42
   return node
×
43
end
44

UNCOV
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
UNCOV
47
   local node = SU.type(spec) == "vglue" and spec or SILE.types.node.vglue(spec)
×
UNCOV
48
   node.explicit = true
×
UNCOV
49
   node.discardable = false
×
UNCOV
50
   node.height.stretch = SILE.types.measurement()
×
UNCOV
51
   node.height.shrink = SILE.types.measurement()
×
UNCOV
52
   local totals = self.frame.state.totals
×
UNCOV
53
   totals.gridCursor = totals.gridCursor + SILE.types.measurement(node.height):absolute()
×
UNCOV
54
   self:pushVertical(node)
×
UNCOV
55
   self:pushVertical(makeUp(self.options.spacing, self.frame.state.totals))
×
UNCOV
56
   return node
×
57
end
58

UNCOV
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