Module:Documentation: Difference between revisions
Jump to navigation
Jump to search
m>Mr. Stradivarius need to check type as well |
m>Mr. Stradivarius 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 | if not content and docTitle.exists then | ||
local frame = mw.getCurrentFrame() | |||
content = frame:preprocess('{{ ' .. docTitle.prefixedText .. ' }}') | |||
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 |