local export =
local function Smyth(section, part) if not part then part = "smythp" end local Part, url if section
nil then url, Part = "No number provided", "No number provided" else sectionNumber = tonumber(section) if sectionNumber
function export.SmythSection(frame) local sectionParameter = frame.args[1] local output, sign = "", "" local sections, postscripts, separators =,, local part = frame.args[2] if sectionParameter then n = 1 if mw.ustring.find(sectionParameter, "[^%d%s]") then for number, postscript, separator in mw.ustring.gmatch(sectionParameter, "(%d+ ?%u?)(%.?[%l%d]?)(%p?[^%d]*)") do sections[n], postscripts[n], separators[n] = number, postscript, separator if sections[n]
nil then break end n = n + 1 end else sections[1], separators[1] = mw.ustring.match(sectionParameter, "(%d+)"), "" end else error("SmythSection wants input in the first parameter") end if #sections
"" or sections[2]
"" or sections[i]
1 then output = output .. sign .. " " end output = output .. sections[i] .. postscripts[i] .. "]" .. separators[i] end end return outputend
function export.SmythPart(frame) local sectionParameter = frame.args[1] local section = mw.ustring.match(sectionParameter, "(%d+)") return Smyth(section).Partend
return export