• 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
/packages/gutenberg/init.lua
1
local base = require("packages.base")
×
2

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

6
function package:registerCommands ()
×
NEW
7
   self:registerCommand("alt", function (_, _)
×
NEW
8
      SU.deprecated("\\alt", "\\alternative", "0.10.0", "0.14.0")
×
NEW
9
   end, "Deprecated")
×
10

NEW
11
   self:registerCommand("alternative", function (_, content)
×
NEW
12
      local alts = {}
×
NEW
13
      for _, fragment in ipairs(content) do
×
NEW
14
         local hbox, hlist = SILE.typesetter:makeHbox({ fragment })
×
NEW
15
         if #hlist > 0 then
×
NEW
16
            SU.error("Forbidden migrating content in alternative")
×
17
         end
NEW
18
         table.insert(alts, hbox)
×
19
      end
NEW
20
      local alternative = SILE.nodefactory.alternative({
×
21
         options = alts,
22
         selected = 1,
23
      })
NEW
24
      alternative.width = nil
×
NEW
25
      SILE.typesetter.state.nodes[#SILE.typesetter.state.nodes + 1] = alternative
×
26
   end)
27
end
28

29
package.documentation = [[
30
\begin{document}
31
Johann Gutenberg’s 42-line Bible is considered a masterpiece of early printing in part due to the quality of justification of every line.
32
To achieve perfect justification color, Gutenberg used a number of ligatures, abbreviations, substitutions, and so on.
33

34
As an experiment in extending SILE’s justification engine, the \autodoc:package{gutenberg} package allows SILE to choose between a number of different options for a particular piece of text, depending on what would improve the line fitting.
35

36
For instance, issuing the command \autodoc:command{\alternative{\{and\}\{&\}}} would insert either the text \autodoc:example{and} or an ampersand, depending on what best fits the current line.
37
\end{document}
38
]]
×
39

40
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