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

sile-typesetter / sile / 12005578175

25 Nov 2024 07:53AM UTC coverage: 57.011% (-7.3%) from 64.353%
12005578175

push

github

alerque
chore(tooling): Extend and annotate spell check exceptions

11267 of 19763 relevant lines covered (57.01%)

755.25 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

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

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

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

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

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

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

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

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

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

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

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

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