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

sile-typesetter / sile / 14860011647

06 May 2025 12:44PM UTC coverage: 67.057% (+32.5%) from 34.559%
14860011647

push

github

alerque
chore(typesetters): Fixup access to class from typesetter functions

7 of 7 new or added lines in 2 files covered. (100.0%)

1344 existing lines in 103 files now uncovered.

14880 of 22190 relevant lines covered (67.06%)

11549.16 hits per line

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

0.0
/packages/boustrophedon/init.lua
1
local base = require("packages.base")
×
2

3
local package = pl.class(base)
×
4
package._name = "boustrophedon"
×
5

6
local function hackVboxDir (v, dir)
7
   local output = v.outputYourself
×
8
   v.outputYourself = function (self, typesetter, line)
9
      typesetter.frame.direction = dir
×
10
      typesetter.frame:newLine()
×
11
      output(self, typesetter, line)
×
12
   end
13
end
14

15
function package:registerCommands ()
×
16
   self.commands:register("boustrophedon", function (_, content)
×
UNCOV
17
      SILE.typesetter:leaveHmode()
×
UNCOV
18
      local saveBoxup = SILE.typesetter.boxUpNodes
×
UNCOV
19
      SILE.typesetter.boxUpNodes = function (self_)
×
UNCOV
20
         local vboxlist = saveBoxup(self_)
×
UNCOV
21
         local startdir = SILE.typesetter.frame.direction
×
UNCOV
22
         local dir = startdir
×
23
         for i = 1, #vboxlist do
×
UNCOV
24
            if vboxlist[i].is_vbox then
×
25
               hackVboxDir(vboxlist[i], dir)
×
26
               dir = dir == "LTR-TTB" and "RTL-TTB" or "LTR-TTB"
×
27
            end
28
         end
UNCOV
29
         if startdir == dir then
×
UNCOV
30
            local restore = SILE.types.node.vbox({})
×
31
            restore.outputYourself = function (_, typesetter, _)
32
               typesetter.frame.direction = startdir
×
33
               typesetter.frame:newLine()
×
34
            end
35
            vboxlist[#vboxlist + 1] = restore
×
36
         end
37
         return vboxlist
×
38
      end
39
      SILE.process(content)
×
40
      SILE.typesetter:leaveHmode()
×
41
      SILE.typesetter.boxUpNodes = saveBoxup
×
42
   end)
43
end
44

45
package.documentation = [[
46
\begin{document}
47
\use[module=packages.boustrophedon]
48
Partly designed to show off SILE’s extensibility, and partly designed for real use by classicists, the \autodoc:package{boustrophedon} package allows you to typeset ancient Greek texts in the “ox-turning” layout: the first line is written left to right as normal, but the next is set right to left, then left to right, and so on.
49
To use it, you will need to set the font’s language to ancient Greek (\code{grc}) and wrap text in a \autodoc:environment{boustrophedon} environment:
50

51
\set[parameter=document.parindent,value=0]{\par
52
\begin{boustrophedon}
53
\font[size=22pt,family=Gentium Plus,language=grc]
54
\noindent{}ΧΑΙΡΕΔΕΜΟΤΟΔΕΣΕΜΑΠΑΤΕΡΕΣΤΕΣΕΘΑΝΟΝΤΟΣΑΝΦΙΧΑΡΕΣΑΓΑΘΟΝΠΑΙΔΑΟΛΟΦΘΡΟΜΕΝΟΣΦΑΙΔΙΜΟΣΕΠΟΙΕ
55
\end{boustrophedon}
56
}
57

58
(Under normal circumstances, that line would appear as \font[language=grc,family=Gentium Plus]{
59
ΧΑΙΡΕΔΕΜΟΤΟΔΕΣΕΜΑΠΑΤΕΡΕΣΤΕΣΕΘΑΝΟΝΤΟΣΑΝΦΙΧΑΡΕΣΑΓΑΘΟΝΠΑΙΔΑΟΛΟΦΘΡΟΜΕΝΟΣΦΑΙΔΙΜΟΣΕΠΟΙΕ
60
}.)
61

62
\end{document}
UNCOV
63
]]
×
64

UNCOV
65
return package
×
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