All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
4 Licensed under MIT License
5 * (c) 2013, Luke Bonham
6 * (c) 2009, Uli Schlachter
11 local beautiful = require("beautiful")
12 local tostring = tostring
13 local setmetatable = setmetatable
15 -- Lain markup util submodule
23 function markup.bold(text) return '<b>' .. tostring(text) .. '</b>' end
24 function markup.italic(text) return '<i>' .. tostring(text) .. '</i>' end
25 function markup.strike(text) return '<s>' .. tostring(text) .. '</s>' end
26 function markup.underline(text) return '<u>' .. tostring(text) .. '</u>' end
27 function markup.monospace(text) return '<tt>' .. tostring(text) .. '</tt>' end
28 function markup.big(text) return '<big>' .. tostring(text) .. '</big>' end
29 function markup.small(text) return '<small>' .. tostring(text) .. '</small>' end
32 function markup.font(font, text)
33 return '<span font="' .. tostring(font) .. '">' .. tostring(text) ..'</span>'
36 -- Set the foreground.
37 function fg.color(color, text)
38 return '<span foreground="' .. tostring(color) .. '">' .. tostring(text) .. '</span>'
41 -- Set the background.
42 function bg.color(color, text)
43 return '<span background="' .. tostring(color) .. '">' .. tostring(text) .. '</span>'
47 function fg.focus(text) return fg.color(beautiful.fg_focus, text) end
48 function bg.focus(text) return bg.color(beautiful.bg_focus, text) end
49 function markup.focus(text) return bg.focus(fg.focus(text)) end
52 function fg.normal(text) return fg.color(beautiful.fg_normal, text) end
53 function bg.normal(text) return bg.color(beautiful.bg_normal, text) end
54 function markup.normal(text) return bg.normal(fg.normal(text)) end
57 function fg.urgent(text) return fg.color(beautiful.fg_urgent, text) end
58 function bg.urgent(text) return bg.color(beautiful.bg_urgent, text) end
59 function markup.urgent(text) return bg.urgent(fg.urgent(text)) end
64 -- link markup.{fg,bg}(...) calls to markup.{fg,bg}.color(...)
65 setmetatable(markup.fg, { __call = function(_, ...) return markup.fg.color(...) end })
66 setmetatable(markup.bg, { __call = function(_, ...) return markup.bg.color(...) end })
68 -- link markup(...) calls to markup.fg.color(...)
69 return setmetatable(markup, { __call = function(_, ...) return markup.fg.color(...) end })