Difference between revisions of "Module:Documentation"

92 bytes removed ,  16:02, 19 January 2014
allow documentation passed with the |content= parameter to show even if we get errors from the env table
>Mr. Stradivarius
(simplify the start box code and attempt to get some more output if the env table contains errors)
>Mr. Stradivarius
(allow documentation passed with the |content= parameter to show even if we get errors from the env table)
Line 516: Line 516:


function p._content(args, env)
function p._content(args, env)
-- Get the /doc title object
local docTitle = env.docTitle
local docTitle = env.docTitle
if not docTitle then
return nil
end
-- Get the documentation content.
local content = args.content
local content = args.content
if not content and docTitle.exists then
if not content and docTitle and docTitle.exists then
local frame = mw.getCurrentFrame()
local frame = mw.getCurrentFrame()
content = frame:preprocess('{{ ' .. docTitle.prefixedText .. ' }}')
content = frame:preprocess('{{ ' .. docTitle.prefixedText .. ' }}')
Anonymous user