Module:Demo: Difference between revisions

372 bytes added ,  5 years ago
Created page with "local p = {} --creates a frame object that cannot access any of the parent's args --unless a table containing a list keys of not to inherit is provided function disinherit(fr..."
m (1 revision imported)
en>Centrist16
(Created page with "local p = {} --creates a frame object that cannot access any of the parent's args --unless a table containing a list keys of not to inherit is provided function disinherit(fr...")
Line 55:
end
return string.format('<pre%s>%s</pre>%s%s', args.style and string.format(" style='%s'", args.style) or '', show.source, args.br, show.output)
end
 
-- Alternate function to return an inline result
function p.inline(frame, demoTable)
local show = demoTable or p.get(frame)
local args = show.frame.args
if show[args.result_arg] then
return show[args.result_arg]
end
return string.format('<code%s>%s</code>%s%s', args.style and string.format(" style='%s'", args.style) or '', show.source, ' → ', show.output)
end
 
Anonymous user