Changes

Jump to: navigation, search

Module:Documentation

404 bytes added, 21:23, 27 December 2013
make startBox, content and endBox accessible from #invoke
----------------------------------------------------------------------------
-- Main functionsArgument processing
----------------------------------------------------------------------------
local function makeInvokeFunc(funcName) return function p.main(frame) local args = getArgs(frame, { valueFunc = function (key, value) if type(value) == 'string' then value = value:match('^%s*(.-)%s*$') -- Remove whitespace. if key == 'heading' or value ~= '' then return value else return nil end else
return value
else
return nil
end
else
return value
end
end }) return p._main[funcName](args) end
end
 
----------------------------------------------------------------------------
-- Main functions
----------------------------------------------------------------------------
 
p.main = makeInvokeFunc('_main')
function p._main(args)
.attr('id', 'template-documentation')
.addClass('template-documentation iezoomfix')
.wikitext(p.startBox_startBox(args)) .wikitext(p.content_content(args))
.tag('div')
.css('clear', 'both') -- So right or left floating items don't stick out of the doc box.
.done()
.done()
.wikitext(p.endBox_endBox(args))
.wikitext(p.addTrackingCategories())
return tostring(root)
end
p.startBox = makeInvokeFunc('_startBox') function p.startBox_startBox(args)
-- Arg processing from {{documentation}}.
local preload = args.preload -- Allow custom preloads.
end
p.content = makeInvokeFunc('_content') function p.content_content(args)
local content = args.content
if not content then
end
p.endBox = makeInvokeFunc('_endBox') function p.endBox_endBox(args)
-- Argument processing in {{documentation}}.
local preload = args.preload -- Allow custom preloads.
Anonymous user

Navigation menu