Anonymous user
Module:Documentation: Difference between revisions
make startBox, content and endBox accessible from #invoke
(more efficient code for the subpages link) |
(make startBox, content and endBox accessible from #invoke) |
||
Line 41:
----------------------------------------------------------------------------
-- Argument processing
-- Main functions▼
----------------------------------------------------------------------------
local function
local args = getArgs(frame, {
valueFunc = function (key, value)
if type(value) ==
value = value:match('^%s*(.-)%s*$') -- Remove whitespace.
return value▼
else▼
return nil
end
else
return
end
▲ else
▲ return value
end
end
▲ return p._main(args)
end
----------------------------------------------------------------------------
▲-- Main functions
----------------------------------------------------------------------------
p.main = makeInvokeFunc('_main')
function p._main(args)
Line 72 ⟶ 80:
.attr('id', 'template-documentation')
.addClass('template-documentation iezoomfix')
.wikitext(p.
.wikitext(p.
.tag('div')
.css('clear', 'both') -- So right or left floating items don't stick out of the doc box.
.done()
.done()
.wikitext(p.
.wikitext(p.addTrackingCategories())
return tostring(root)
Line 120 ⟶ 128:
end
function p._startBox(args)
-- Arg processing from {{documentation}}.
local preload = args.preload -- Allow custom preloads.
Line 214 ⟶ 224:
end
function p._content(args)
local content = args.content
if not content then
Line 234 ⟶ 246:
end
function p._endBox(args)
-- Argument processing in {{documentation}}.
local preload = args.preload -- Allow custom preloads.
|