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

sile-typesetter / sile / 11645827362

02 Nov 2024 09:08PM UTC coverage: 54.19% (-15.2%) from 69.34%
11645827362

push

github

web-flow
Merge pull request #2151 from Omikhleia/math-more-fixes-and-features

Math more fixes and features

103 of 208 new or added lines in 4 files covered. (49.52%)

2652 existing lines in 91 files now uncovered.

9816 of 18114 relevant lines covered (54.19%)

671.83 hits per line

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

0.0
/classes/letter.lua
1
--- letter document class.
2
-- @use classes.letter
3

UNCOV
4
local plain = require("classes.plain")
×
5

UNCOV
6
local class = pl.class(plain)
×
UNCOV
7
class._name = "letter"
×
8

UNCOV
9
class.defaultFrameset = {
×
UNCOV
10
   content = {
×
11
      left = "5%pw",
12
      right = "95%pw",
13
      top = "2in",
14
      bottom = "90%ph",
15
   },
16
}
17

UNCOV
18
function class:_init (options)
×
UNCOV
19
   plain._init(self, options)
×
UNCOV
20
   SILE.scratch.letter = {
×
21
      sender = nil,
22
      date = nil,
23
      recipient = "",
24
      salutation = "",
25
   }
26
end
27

UNCOV
28
function class:registerCommands ()
×
UNCOV
29
   plain.registerCommands(self)
×
30

UNCOV
31
   self:registerCommand("letter", function (_, content)
×
UNCOV
32
      SILE.settings:set("current.parindent", SILE.types.node.glue())
×
UNCOV
33
      SILE.settings:set("document.parindent", SILE.types.node.glue())
×
UNCOV
34
      SILE.call("raggedright", {}, function ()
×
UNCOV
35
         SILE.call("letter:format:date")
×
UNCOV
36
         SILE.call("bigskip")
×
UNCOV
37
         if SILE.scratch.letter.sender then
×
38
            SILE.call("letter:format:sender")
×
39
            SILE.call("bigskip")
×
40
         end
UNCOV
41
         SILE.call("letter:format:recipient")
×
UNCOV
42
         SILE.call("bigskip")
×
UNCOV
43
         SILE.call("letter:format:salutation")
×
UNCOV
44
         SILE.call("bigskip")
×
UNCOV
45
         SILE.process(content)
×
46
      end)
47
   end)
48

UNCOV
49
   self:registerCommand("sender", function (_, content)
×
50
      SILE.scratch.letter.sender = content
×
51
   end)
UNCOV
52
   self:registerCommand("recipient", function (_, content)
×
UNCOV
53
      SILE.scratch.letter.recipient = content
×
54
   end)
UNCOV
55
   self:registerCommand("salutation", function (_, content)
×
UNCOV
56
      SILE.scratch.letter.salutation = content
×
57
   end)
UNCOV
58
   self:registerCommand("date", function (_, content)
×
59
      SILE.scratch.letter.date = content
×
60
   end)
61

UNCOV
62
   self:registerCommand("letter:format:date", function ()
×
UNCOV
63
      if not SILE.scratch.letter.date then
×
UNCOV
64
         SILE.scratch.letter.date = { os.date("%A, %d %B") }
×
65
      end
UNCOV
66
      SILE.process(SILE.scratch.letter.date)
×
UNCOV
67
      SILE.call("par")
×
68
   end)
69

UNCOV
70
   self:registerCommand("letter:format:sender", function ()
×
71
      SILE.process(SILE.scratch.letter.sender)
×
72
   end)
73

UNCOV
74
   self:registerCommand("letter:format:recipient", function ()
×
UNCOV
75
      SILE.process(SILE.scratch.letter.recipient)
×
76
   end)
77

UNCOV
78
   self:registerCommand("letter:format:salutation", function ()
×
UNCOV
79
      SILE.process(SILE.scratch.letter.salutation)
×
80
   end)
81
end
82

UNCOV
83
return class
×
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