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

sile-typesetter / sile / 14390735465

10 Apr 2025 09:30PM UTC coverage: 34.559% (-31.7%) from 66.23%
14390735465

push

github

alerque
Merge tag 'v0.15.12' into develop

4 of 4 new or added lines in 3 files covered. (100.0%)

4064 existing lines in 73 files now uncovered.

6918 of 20018 relevant lines covered (34.56%)

2597.26 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 ()
×
7
   self:registerCommand("alternative", function (_, content)
×
8
      local alts = {}
×
9
      for _, fragment in ipairs(content) do
×
UNCOV
10
         local hbox, hlist = SILE.typesetter:makeHbox({ fragment })
×
11
         if #hlist > 0 then
×
12
            SU.error("Forbidden migrating content in alternative")
×
13
         end
14
         table.insert(alts, hbox)
×
15
      end
16
      local alternative = SILE.types.node.alternative({
×
17
         options = alts,
18
         selected = 1,
19
      })
20
      alternative.width = nil
×
UNCOV
21
      SILE.typesetter.state.nodes[#SILE.typesetter.state.nodes + 1] = alternative
×
22
   end)
23
end
24

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

30
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.
31

32
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.
33
\end{document}
UNCOV
34
]]
×
35

UNCOV
36
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