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

sile-typesetter / sile / 9428435077

08 Jun 2024 11:35AM UTC coverage: 64.56% (-9.9%) from 74.46%
9428435077

push

github

web-flow
Merge pull request #2047 from alerque/end-pars

23 of 46 new or added lines in 5 files covered. (50.0%)

1684 existing lines in 60 files now uncovered.

11145 of 17263 relevant lines covered (64.56%)

4562.45 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/packages/date/init.lua
UNCOV
1
local base = require("packages.base")
×
2

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

6
local localeify = function (lang)
7
   lang = lang == "en-u-va-posix" and "en" or lang
×
8
   return lang .. "_" .. string.upper(lang) .. ".utf-8"
×
9
end
10

UNCOV
11
function package.date (_, options)
×
12
   options.format = options.format or "%c"
×
13
   options.time = options.time or os.time()
×
14
   options.locale = options.locale or localeify(SILE.settings:get("document.language"))
×
15
   os.setlocale(options.locale, "time")
×
16
   return os.date(options.format, options.time)
×
17
end
18

UNCOV
19
function package:_init ()
×
UNCOV
20
   base._init(self)
×
UNCOV
21
   self:deprecatedExport("date", self.date)
×
22
end
23

UNCOV
24
function package:registerCommands ()
×
UNCOV
25
   self:registerCommand("date", function (options, _)
×
26
      local datestring = self:date(options)
×
27
      SILE.typesetter:typeset(datestring)
×
UNCOV
28
   end, "Output a timestamp using the system date function")
×
29
end
30

31
package.documentation = [[
32
\begin{document}
33
The \autodoc:package{date} package provides the \autodoc:command{\date} command, which simply outputs a date using the system’s date function.
34
It defaults to the current date and time, but can be used to format any other input time as well using the \autodoc:parameter{time} parameter.
35
You can customize the format by passing the \autodoc:parameter{format} parameter, following the formatting codes in the Lua manual
36
(\url{https://www.lua.org/pil/22.1.html}).
37
\end{document}
UNCOV
38
]]
×
39

UNCOV
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

© 2025 Coveralls, Inc