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

sile-typesetter / sile / 9304060604

30 May 2024 02:07PM UTC coverage: 74.124% (-0.6%) from 74.707%
9304060604

push

github

alerque
style: Reformat Lua with stylua

8104 of 11995 new or added lines in 184 files covered. (67.56%)

15 existing lines in 11 files now uncovered.

12444 of 16788 relevant lines covered (74.12%)

7175.1 hits per line

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

89.36
/classes/letter.lua
1
local plain = require("classes.plain")
1✔
2

3
local class = pl.class(plain)
1✔
4
class._name = "letter"
1✔
5

6
class.defaultFrameset = {
1✔
7
   content = {
1✔
8
      left = "5%pw",
9
      right = "95%pw",
10
      top = "2in",
11
      bottom = "90%ph",
12
   },
1✔
13
}
1✔
14

15
function class:_init (options)
1✔
16
   plain._init(self, options)
1✔
17
   SILE.scratch.letter = {
1✔
18
      sender = nil,
19
      date = nil,
20
      recipient = "",
21
      salutation = "",
22
   }
1✔
23
end
24

25
function class:registerCommands ()
1✔
26
   plain.registerCommands(self)
1✔
27

28
   self:registerCommand("letter", function (_, content)
2✔
29
      SILE.settings:set("current.parindent", SILE.nodefactory.glue())
2✔
30
      SILE.settings:set("document.parindent", SILE.nodefactory.glue())
2✔
31
      SILE.call("raggedright", {}, function ()
2✔
32
         SILE.call("letter:format:date")
1✔
33
         SILE.call("bigskip")
1✔
34
         if SILE.scratch.letter.sender then
1✔
NEW
35
            SILE.call("letter:format:sender")
×
NEW
36
            SILE.call("bigskip")
×
37
         end
38
         SILE.call("letter:format:recipient")
1✔
39
         SILE.call("bigskip")
1✔
40
         SILE.call("letter:format:salutation")
1✔
41
         SILE.call("bigskip")
1✔
42
         SILE.process(content)
1✔
43
      end)
44
   end)
45

46
   self:registerCommand("sender", function (_, content)
2✔
NEW
47
      SILE.scratch.letter.sender = content
×
48
   end)
49
   self:registerCommand("recipient", function (_, content)
2✔
50
      SILE.scratch.letter.recipient = content
1✔
51
   end)
52
   self:registerCommand("salutation", function (_, content)
2✔
53
      SILE.scratch.letter.salutation = content
1✔
54
   end)
55
   self:registerCommand("date", function (_, content)
2✔
NEW
56
      SILE.scratch.letter.date = content
×
57
   end)
58

59
   self:registerCommand("letter:format:date", function ()
2✔
60
      if not SILE.scratch.letter.date then
1✔
61
         SILE.scratch.letter.date = { os.date("%A, %d %B") }
1✔
62
      end
63
      SILE.process(SILE.scratch.letter.date)
1✔
64
      SILE.call("par")
1✔
65
   end)
66

67
   self:registerCommand("letter:format:sender", function ()
2✔
NEW
68
      SILE.process(SILE.scratch.letter.sender)
×
69
   end)
70

71
   self:registerCommand("letter:format:recipient", function ()
2✔
72
      SILE.process(SILE.scratch.letter.recipient)
1✔
73
   end)
74

75
   self:registerCommand("letter:format:salutation", function ()
2✔
76
      SILE.process(SILE.scratch.letter.salutation)
1✔
77
   end)
78
end
79

80
return class
1✔
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