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

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

6
local icu = require("justenoughicu")
×
7

8
function package:uppercase (input, extraArgs)
×
9
   if type(self) ~= "table" or (self.type ~= "class" and self.type ~= "package") then
×
10
      input, extraArgs = self, input
×
11
   end
12
   if not extraArgs then
×
13
      extraArgs = {}
×
14
   end
15
   if not extraArgs.options then
×
16
      extraArgs.options = {}
×
17
   end
18
   local lang = extraArgs.options.language or SILE.settings:get("document.language")
×
19
   return icu.case(input, lang, "upper")
×
20
end
21

22
function package:lowercase (input, extraArgs)
×
23
   if type(self) ~= "table" or (self.type ~= "class" and self.type ~= "package") then
×
24
      input, extraArgs = self, input
×
25
   end
26
   if not extraArgs then
×
27
      extraArgs = {}
×
28
   end
29
   if not extraArgs.options then
×
30
      extraArgs.options = {}
×
31
   end
32
   local lang = extraArgs.options.language or SILE.settings:get("document.language")
×
33
   return icu.case(input, lang, "lower")
×
34
end
35

36
function package:titlecase (input, extraArgs)
×
37
   if type(self) ~= "table" or (self.type ~= "class" and self.type ~= "package") then
×
38
      input, extraArgs = self, input
×
39
   end
40
   if not extraArgs then
×
41
      extraArgs = {}
×
42
   end
43
   if not extraArgs.options then
×
44
      extraArgs.options = {}
×
45
   end
46
   local lang = extraArgs.options.language or SILE.settings:get("document.language")
×
47
   return icu.case(input, lang, "title")
×
48
end
49

50
function package:_init ()
×
51
   base._init(self)
×
52
   self:loadPackage("inputfilter")
×
53
end
54

55
function package:registerCommands ()
×
UNCOV
56
   self:registerCommand("uppercase", function (options, content)
×
UNCOV
57
      SILE.process(self.class.packages.inputfilter:transformContent(content, self.uppercase, options))
×
58
   end, "Typeset the enclosed text as uppercase")
×
59

60
   self:registerCommand("lowercase", function (options, content)
×
61
      SILE.process(self.class.packages.inputfilter:transformContent(content, self.lowercase, options))
×
UNCOV
62
   end, "Typeset the enclosed text as lowercase")
×
63

64
   self:registerCommand("titlecase", function (options, content)
×
65
      SILE.process(self.class.packages.inputfilter:transformContent(content, self.titlecase, options))
×
UNCOV
66
   end, "Typeset the enclosed text as titlecase")
×
67
end
68

69
package.documentation = [[
70
\begin{document}
71
\use[module=packages.textcase]
72
The \autodoc:package{textcase} package provides commands for language-aware case conversion of input text.
73
For example, when language is set to English, then \autodoc:command{\uppercase{hij}} will return \autodoc:example{\uppercase{hij}}.
74
However, when language is set to Turkish, it will return \autodoc:example{\font[language=tr]{\uppercase{hij}}}.
75

76
As well as \autodoc:command{\uppercase}, the package provides the commands \autodoc:command{\lowercase} and \autodoc:command{\titlecase}.
77
\end{document}
UNCOV
78
]]
×
79

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

© 2025 Coveralls, Inc