• 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

0.0
/classes/pecha.lua
1
local plain = require("classes.plain")
×
2

3
local class = pl.class(plain)
×
4
class._name = "pecha"
×
5

6
local tibetanNumber = function (n)
NEW
7
   local out = ""
×
NEW
8
   local a = 0x0f20
×
9
   repeat
NEW
10
      out = luautf8.char(n % 10 + a) .. out
×
NEW
11
      n = (n - n % 10) / 10
×
NEW
12
   until n < 1
×
NEW
13
   return out
×
14
end
15

16
class.defaultFrameset = {
×
NEW
17
   content = {
×
18
      left = "5%pw",
19
      right = "95%pw",
20
      top = "5%ph",
21
      bottom = "90%ph",
22
   },
NEW
23
   folio = {
×
24
      left = "right(content)",
25
      rotate = -90,
26
      width = "2.5%pw",
27
      top = "top(content)",
28
      height = "height(content)",
29
   },
NEW
30
   runningHead = {
×
31
      width = "2.5%pw",
32
      rotate = -90,
33
      right = "left(content)",
34
      top = "top(content)",
35
      height = "height(content)",
36
   },
37
}
38

NEW
39
function class:_init (options)
×
NEW
40
   plain._init(self, options)
×
NEW
41
   self:loadPackage("rotate")
×
NEW
42
   self:registerPostinit(function ()
×
NEW
43
      SILE.call("language", { main = "bo" })
×
NEW
44
      SILE.settings:set("document.lskip", SILE.nodefactory.hfillglue())
×
NEW
45
      SILE.settings:set("typesetter.parfillskip", SILE.nodefactory.glue())
×
NEW
46
      SILE.settings:set("document.parindent", SILE.nodefactory.glue())
×
47
   end)
48
end
49

NEW
50
function class:endPage ()
×
NEW
51
   local folioframe = SILE.getFrame("folio")
×
NEW
52
   SILE.typesetNaturally(folioframe, function ()
×
NEW
53
      SILE.settings:pushState()
×
54
      -- Restore the settings to the top of the queue, which should be the document #986
NEW
55
      SILE.settings:toplevelState()
×
NEW
56
      SILE.settings:set("typesetter.breakwidth", folioframe:height())
×
NEW
57
      SILE.typesetter:typeset(" ")
×
NEW
58
      SILE.call("vfill")
×
NEW
59
      SILE.call("pecha-folio-font")
×
NEW
60
      SILE.call("center", {}, function ()
×
NEW
61
         SILE.typesetter:typeset(tibetanNumber(SILE.scratch.counters.folio.value))
×
62
      end)
NEW
63
      SILE.call("vfill")
×
NEW
64
      SILE.typesetter:leaveHmode()
×
NEW
65
      SILE.settings:popState()
×
66
   end)
NEW
67
   return plain.endPage(self)
×
68
end
69

NEW
70
function class:newPage ()
×
NEW
71
   SILE.outputter:newPage()
×
NEW
72
   SILE.outputter:debugFrame(SILE.getFrame("content"))
×
NEW
73
   return self:initialFrame()
×
74
end
75

76
return class
×
77

78
-- \right-running-head{\font[size=15pt]{\center{ཤེས་རབ་སྙིང་པོ་ }}}
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