Module:Sandbox/Nihiltres/Testing: Difference between revisions

Content deleted Content added
m Removed table wrapper
m Changed default test class to "unassessed"
 
(One intermediate revision by the same user not shown)
Line 4:
local foo = 'Result of tested Lua snippet would be here.'
local bar = mw.loadData('Module:SandboxClass/Nihiltres/ImportimportDefinitions')
local foo = mw.html.create("td")
local dtc = "gaunassessed" --default test class
local class = bar[frame.args[1] or dtc] or bar[dtc]
local styleBasics = "text-align: center; font-weight: bold; "
Line 13:
styleBasics .. string.format("background-color: %s;", class.colour)
)
local img = class.iconDefaulticon.default and string.format(
"[[File:%s|16px|%s|link=|alt=]] ",
class.icon.file,
class.labelFulllabels.full
) or ""
local link = string.format(
"[[:%s|%s]]",
class.category,
class.labelShortlabels.short
)
foo:wikitext(img, link)