Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Documentation: Difference between revisions

Content added Content deleted
(need to check type as well)
(simplify the content function)
Line 505: Line 505:


function p._content(args, env)
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
local content = args.content
if not content then
if not content and docTitle.exists then
local docpage = args[1]
local frame = mw.getCurrentFrame()
content = frame:preprocess('{{ ' .. docTitle.prefixedText .. ' }}')
if docpage and mw.title.new(docpage).exists then
local frame = mw.getCurrentFrame()
content = frame:preprocess('{{ ' .. docpage .. ' }}')
else
docpage = env.docspace .. ':' .. env.templatePage .. '/' .. message('docSubpage', 'string')
if mw.title.new(docpage).exists then
local frame = mw.getCurrentFrame()
content = frame:preprocess('{{ ' .. docpage .. ' }}')
end
end
end
end
-- The line breaks below are necessary so that "=== Headings ===" at the start and end
-- The line breaks below are necessary so that "=== Headings ===" at the start and end
Cookies help us deliver our services. By using our services, you agree to our use of cookies.