Changes

Module:Documentation

108 bytes removed, 19:43, 15 January 2014
simplify the content function
function p._content(args, env)
-- Get the /doc title object
local success, docTitle = env:grab('docTitle')
if not success then
return docTitle -- docTitle is an error message
end
-- Get the documentation content.
local content = args.content
if not content then local docpage = args[1] if docpage and mw.title.new(docpage)docTitle.exists then local frame = mw.getCurrentFrame() content = frame:preprocess('{{ ' .. docpage .. ' }}') else docpage = env.docspace .. ':' .. env.templatePage .docTitle. '/' .. message('docSubpage', 'string') if mw.title.new(docpage).exists then local frame = mw.getCurrentFrame() content = frame:preprocess('{{ ' .. docpage prefixedText .. ' }}') end end
end
-- The line breaks below are necessary so that "=== Headings ===" at the start and end
Anonymous user