This is more of an editing test than a proper module. It serves the same broad function as {{demo}} and {{xpd}}. Each of these three tools has its own set of peculiarities and defects. If one of them breaks under some circumstances, try one of the other two.
--For some reason I couldn't get {{xpd}} to deal with named parameters
local p = {}
defaultSeparator = "\n\n"
function p.xpd(frame)
tmp, tlx = "", ""
args={}
for k,v in pairs(frame.args) do
if k == 1 then
templateName = v
tlx = "{{" .. templateName
elseif type(k) == "number" then
args[k-1] = v
tlx = tlx .. "|" .. v
elseif k == "separator" and not separator then
separator = v
else
args[k] = v
tlx = tlx .. "|" .. k .. " = " .. v
end
end
if not separator then separator = defaultSeparator end
tlx = tlx .. "}}"
return "<pre>" .. tlx .. "</pre>" .. separator .. frame:expandTemplate{title = templateName, args = args}
end
return p