Difference between revisions of "Module:HonorTabs"
From Pathfinder Wiki
DesignerThan (talk | contribs) |
DesignerThan (talk | contribs) |
||
Line 33: | Line 33: | ||
end | end | ||
local t={} | local t={} | ||
− | for str in string.gmatch(inputstring, | + | for str in string.gmatch(inputstring, seperator) do |
table.insert(t, str) | table.insert(t, str) | ||
end | end |
Revision as of 20:53, 27 April 2021
Documentation for this module may be created at Module:HonorTabs/doc
local p = {}
function p.hello( frame )
return "Hello, world!"
end
function p.getLangSuffix( frame )
return frame:expandTemplate{ title = 'GetLangSuffix' }
end
function p.createAnswerTab( frame )
if frame.args.answerVariants then
return "There are answer variants: " .. prepareAnswerVariants(frame.args.answerVariants)
else
return "There aren't any answer variants!"
end
end
function prepareAnswerVariants(variants)
t_variants = splitString(variants, ";;")
result_string = ""
for key, value in pairs(t_variants) do
result_string = result_string .. " * " .. key .. " -- " .. value
end
return result_string
end
function splitString(inputstring, seperator)
if seperator == nil then
seperator = "%s"
end
local t={}
for str in string.gmatch(inputstring, seperator) do
table.insert(t, str)
end
return t
end
return p