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

sile-typesetter / sile / 4660415659

pending completion
4660415659

push

github

Caleb Maclennan
Merge remote-tracking branch 'upstream/master' into unlua

9516 of 9516 new or added lines in 142 files covered. (100.0%)

11643 of 15659 relevant lines covered (74.35%)

6933.75 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

8
  self:registerCommand("alt", function (_, _)
×
9
    SU.deprecated("\\alt", "\\alternative", "0.10.0", "0.14.0")
×
10
  end, "Deprecated")
×
11

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

29
end
30

31
package.documentation = [[
32
\begin{document}
33
Johann Gutenberg’s 42-line Bible is considered a masterpiece of early printing in part due to the quality of justification of every line.
34
To achieve perfect justification color, Gutenberg used a number of ligatures, abbreviations, substitutions, and so on.
35
As an experiment in extending SILE’s justification engine, the \code{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.
36

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

41
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

© 2024 Coveralls, Inc