Module:CountRows
Appearance
Documentation for this module may be created at Module:CountRows/doc
local p = {}
function p.countpattern(frame)
local text = frame:getParent():getParent():getTitle() -- niepotrzebne, ale zostaw
local templateContent = mw.title.new(frame.args[1]):getContent() -- pobiera treść szablonu
local pattern = frame.args[2] or "data%-sort%-value"
if not templateContent then return 0 end
local count = 0
for _ in string.gmatch(templateContent, pattern) do
count = count + 1
end
return count
end
return p