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

sile-typesetter / sile / 14860011647

06 May 2025 12:44PM UTC coverage: 67.057% (+32.5%) from 34.559%
14860011647

push

github

alerque
chore(typesetters): Fixup access to class from typesetter functions

7 of 7 new or added lines in 2 files covered. (100.0%)

1344 existing lines in 103 files now uncovered.

14880 of 22190 relevant lines covered (67.06%)

11549.16 hits per line

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

80.77
/core/misc.lua
1
-- TODO: this probably needs deprecating, moved here just to get out of the way so
2
-- typesetters classing works as expected
3
local function typesetNaturally (frame, func)
4
   local saveTypesetter = SILE.typesetter
88✔
5
   if SILE.typesetter.frame then
88✔
6
      SILE.typesetter.frame:leave(SILE.typesetter)
88✔
7
   end
8
   SILE.typesetter = SILE.typesetters.default(frame)
176✔
9
   SILE.settings:temporarily(func)
176✔
10
   SILE.typesetter:leaveHmode()
88✔
11
   SILE.typesetter:chuck()
88✔
12
   SILE.typesetter.frame:leave(SILE.typesetter)
88✔
13
   SILE.typesetter = saveTypesetter
88✔
14
   if SILE.typesetter.frame then
88✔
15
      SILE.typesetter.frame:enter(SILE.typesetter)
88✔
16
   end
17
end
18

19
local function call (name, options, content)
20
   -- We used to set a global default typesetter all the time, now the class handling firing one up for itself. This
21
   -- leaves library usage (outside of our CLI) and some of our unit tests a bit out in the cold.
22
   if not SILE.typesetter then
3,015✔
UNCOV
23
      SU.deprecated("SILE.init()", "SILE.init(); SILE.typesetter = SILE.typesetters.default()", "0.16.0", "0.17.0")
×
UNCOV
24
      SILE.typesetter = SILE.typesetters.default()
×
25
   end
26
   return SILE.commands:call(name, options, content)
6,030✔
27
end
28

29
-- TODO: Move to new table entry handler in types.unit
30
local function registerUnit (unit, spec)
31
   -- If a unit exists already, clear it first so we get fresh meta table entries, see #1607
32
   if SILE.types.unit[unit] then
18✔
UNCOV
33
      SILE.types.unit[unit] = nil
×
34
   end
35
   SILE.types.unit[unit] = spec
18✔
36
end
37

38
local function paperSizeParser (size)
UNCOV
39
   SU.deprecated("SILE.paperSizeParser", "SILE.papersize", "0.15.0", "0.16.0")
×
UNCOV
40
   return SILE.papersize(size)
×
41
end
42

43
return {
302✔
44
   typesetNaturally = typesetNaturally,
302✔
45
   call = call,
302✔
46
   registerUnit = registerUnit,
302✔
47
   paperSizeParser = paperSizeParser,
302✔
48
}
302✔
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

© 2025 Coveralls, Inc