-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreview.lua
30 lines (25 loc) · 1012 Bytes
/
review.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require("packages/rules")
require("packages/color")
-- TODO line numbers!
SILE.registerCommand("sout", function (_, content)
-- check if the underline code in rules package is different
local hbox = SILE.call("hbox", {}, content)
local gl = SILE.length() - hbox.width
SILE.call("raise", {height = "0.5ex"}, function()
SILE.call("hrule", {width = gl.length, height = "0.5pt"})
end)
SILE.typesetter:pushGlue({width = hbox.width})
end, "Strickeout some content (badly)")
SILE.registerCommand("hl", function (_, content)
SILE.call("color", {color = "yellow"}, function()
local hbox = SILE.call("hbox", {}, content)
local gl = SILE.length() - hbox.width
SILE.call("hrule", {width = gl.length, height = "1.5ex"})
end)
SILE.call("hbox", {}, content)
end, "Highlight content (badly)")
SILE.registerCommand("red", function (_, content)
SILE.call("color", {color = "red"}, function()
SILE.process(content)
end)
end, "Color content red")