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

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

6
function package:registerCommands ()
×
NEW
7
   self:registerCommand("xmltricks:ignore", function (_, content)
×
NEW
8
      for token in SU.gtoke(content[1]) do
×
NEW
9
         if token.string then
×
NEW
10
            SILE.call("define", { command = token.string }, function () end)
×
11
         end
12
      end
13
   end)
14

NEW
15
   self:registerCommand("xmltricks:passthru", function (_, content)
×
NEW
16
      for token in SU.gtoke(content[1]) do
×
NEW
17
         if token.string then
×
NEW
18
            self:registerCommand(token.string, function (_, c)
×
NEW
19
               SILE.process(c)
×
20
            end)
21
         end
22
      end
23
   end)
24
end
25

26
package.documentation = [[
27
\begin{document}
28
In Chapter 9, we’re going to use SILE to typeset existing XML documents.
29
Most of the work of typesetting XML with SILE is creating processing expectations for particular XML tags.
30
\autodoc:package{xmltricks} makes the process somewhat easier by providing commands to handle two common cases.
31

32
\autodoc:command{\xmltricks:ignore{tag1 tag2 tag3}} instructs SILE not to bother investigating the given tags.
33
For instance, when processing a HTML document, you probably don’t need to typeset the \code{head} tag or anything inside it.
34

35
Similarly, some tags are just wrappers; you want to process their content, but there’s nothing specific about the tag itself that needs any styling.
36
List those tags in a \autodoc:command{\xmltricks:passthru{...}} command, and SILE will descend into the content without requiring a specific command for the tag itself.
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