Difference between revisions of "Module:Sandbox/BrandonXLF/2/example"

From blackwiki
Jump to navigation Jump to search
blackwiki>BrandonXLF
blackwiki>BrandonXLF
Line 1: Line 1:
−
--[[ This module acts like example templates for the parent modules documetaion page ]]--
 
−
 
 
local p = {}
 
local p = {}
−
 
 
function p.main (frame)
 
function p.main (frame)
−
local out = ''
+
return frame:preprocess(mw.text.unstripNoWiki(frame.args.CODE))
−
local args = frame.args
 
−
local module = 'Sandbox/BrandonXLF/2'
 
−
local wikitext = {
 
−
[1]  = '{{#invoke:Sandbox/BrandonXLF/2|main|item|, }}',
 
−
[2]  = '{{#invoke:Sandbox/BrandonXLF/2|main||, ||| and }}',
 
−
[3]  = '{{#invoke:Sandbox/BrandonXLF/2|main||, |•|•| and }}',
 
−
[4]  = '{{#invoke:Sandbox/BrandonXLF/2|main|x| & }}',
 
−
[5]  = '{{#invoke:Sandbox/BrandonXLF/2|main|x| & |item $i: }}',
 
−
[6]  = '{{#invoke:Sandbox/BrandonXLF/2|bulleted}}',
 
−
[7]  = '{{#invoke:Sandbox/BrandonXLF/2|unbulleted}}',
 
−
[8]  = '{{#invoke:Sandbox/BrandonXLF/2|horizontal}}',
 
−
[9]  = '{{#invoke:Sandbox/BrandonXLF/2|ordered}}',
 
−
[10] = '{{#invoke:Sandbox/BrandonXLF/2|commas}}',
 
−
[11] = '{{#invoke:Sandbox/BrandonXLF/2|list}}',
 
−
}
 
−
 
−
if args['CODE'] then
 
−
out = '<pre>'..wikitext[tonumber(args['EXAMPLE'])]..'</pre>'
 
−
else
 
−
out = frame:preprocess(wikitext[tonumber(args['EXAMPLE'])])
 
−
end
 
−
 
−
return out
 
−
 
 
 
end
 
end
−
 
 
return p
 
return p

Revision as of 05:07, 2 January 2019

Documentation for this module may be created at Module:Sandbox/BrandonXLF/2/example/doc

local p = {}
function p.main (frame)
	return frame:preprocess(mw.text.unstripNoWiki(frame.args.CODE))
end
return p