Moduł:Wskaźnik
W tym module nie ma dokumentacji. Jeśli wiesz jak używać tego modułu, proszę, podaj odpowiednie informacje.
local p = {}
function give(frame, key)
local result = mw.text.trim(frame.args[key] or '')
return #result > 0 and result or nil
end
function p.indicator(frame)
local empty = give(frame, 'empty') or '{{{1}}}'
local file = give(frame, 'file')
local text = file and '[[Plik:'..file..']]' or give(frame, 'text')
assert(text, 'text')
assert(mw.text.truncate(file or empty, #empty, '') ~= empty, 'file')
frame:extensionTag
{
name = 'indicator',
content = text,
args =
{
name = give(frame, 'name') or tostring(os.time())
},
}
end
return p