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

sile-typesetter / sile / 9400953783

06 Jun 2024 12:32PM UTC coverage: 62.819% (-11.3%) from 74.124%
9400953783

push

github

alerque
Merge branch 'develop'

1752 of 2644 new or added lines in 109 files covered. (66.26%)

2019 existing lines in 84 files now uncovered.

10830 of 17240 relevant lines covered (62.82%)

3306.33 hits per line

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

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

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

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

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

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

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

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

73
function class:newPage ()
×
74
   SILE.outputter:newPage()
×
75
   SILE.outputter:debugFrame(SILE.getFrame("content"))
×
76
   return self:initialFrame()
×
77
end
78

79
return class
×
80

81
-- \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

© 2026 Coveralls, Inc