Difference between revisions of "Module:Documentation"

Jump to navigation Jump to search
m
171 revisions imported
en>Iniquity
m (fix namespace by Vercelas, accidentally overwritten)
m (171 revisions imported)
 
(11 intermediate revisions by 7 users not shown)
Line 1: Line 1:
--[[
  Add your experimental module code here.
--]]
-- This module implements {{documentation}}.
-- This module implements {{documentation}}.


Line 9: Line 6:


-- Get the config table.
-- Get the config table.
local cfg = mw.loadData('Module:Documentation/config/sandbox')
local cfg = mw.loadData('Module:Documentation/config')
local i18n = mw.loadData('Module:Documentation/i18n')
local i18n = mw.loadData('Module:Documentation/i18n')
local p = {}
local p = {}
Line 121: Line 118:
local parent = frame.getParent(frame)
local parent = frame.getParent(frame)
local output = p._main(parent.args)
local output = p._main(parent.args)
return frame:extensionTag{ name='templatestyles', args = { src= message('templatestyles-scr') } } .. frame:preprocess(output)
return frame:extensionTag{ name='templatestyles', args = { src= message('templatestyles-scr') } } .. output
end
end


Line 640: Line 637:
local content = args.content
local content = args.content
if not content and docTitle and docTitle.exists then
if not content and docTitle and docTitle.exists then
content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}
content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle}
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
Line 742: Line 739:
-- 'history-link-display' --> 'history'
-- 'history-link-display' --> 'history'
-- 'transcluded-from-blurb' -->  
-- 'transcluded-from-blurb' -->  
-- 'The above [[Wikipedia:Template documentation|documentation]]  
-- 'The above [[w:Wikipedia:Template documentation|documentation]]  
-- is [[Wikipedia:Transclusion|transcluded]] from $1.'
-- is [[w:Wikipedia:Transclusion|transcluded]] from $1.'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'create-link-display' --> 'create'
-- 'create-link-display' --> 'create'
-- 'create-module-doc-blurb' -->
-- 'create-module-doc-blurb' -->
-- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
-- 'You might want to $1 a documentation page for this [[w:Wikipedia:Lua|Scribunto module]].'
--]=]
--]=]
local docTitle = env.docTitle
local docTitle = env.docTitle
if not docTitle then
if not docTitle or args.content then
return nil
return nil
end
end

Navigation menu