Module:Dochead: Difference between revisions

Ganaram inukshuk (talk | contribs)
mNo edit summary
Ganaram inukshuk (talk | contribs)
add create links
Line 64: Line 64:
function p._dochead(args)
function p._dochead(args)
local namespace = args["namespace"]
local namespace = args["namespace"]
local pagename  = args["pagename"]
local pagename  = args["pagename" ]
local header    = args["header"] or "none"
local header    = args["header"   ] or "none"
local corr_template = args["temp"] or ("Template:" .. pagename)
local corr_template = args["temp"] or ("Template:" .. pagename)
local corr_module  = args["mod"] or ("Module:"  .. pagename)
local corr_module  = args["mod" ] or ("Module:"  .. pagename)


-- If header is none, don't bother
-- If header is none, don't bother
Line 93: Line 93:
result = string.format("This module may be invoked by templates using its corresponding [[%s|template]], or used directly from other modules.", corr_template)
result = string.format("This module may be invoked by templates using its corresponding [[%s|template]], or used directly from other modules.", corr_template)
else
else
result = "This module has a template that is currently missing. [[create]]"
result = string.format("This module has a template that is currently missing. [[Special:EditPage/%s]]", corr_template)
end
end
elseif namespace == "Template" then
elseif namespace == "Template" then
Line 99: Line 99:
result = string.format("This template is implemented by the Lua module [[%s]]. See its module page for Lua-based template implementation.", corr_module)
result = string.format("This template is implemented by the Lua module [[%s]]. See its module page for Lua-based template implementation.", corr_module)
else
else
result = "This template is implemented by a module that is currently missing. [[create]]"
result = string.format("This template is implemented by a module that is currently missing. [[Special:EditPage/%s]]", corr_module)
end
end
else
else
Line 134: Line 134:
result = string.format("This module should not be invoked directly; use its corresponding [[%s|template]] instead.", corr_template)
result = string.format("This module should not be invoked directly; use its corresponding [[%s|template]] instead.", corr_template)
else
else
result = "This module implements a template that is currently missing. [[create]]"
result = string.format("This module implements a template that is currently missing. [[Special:EditPage/%s]]", corr_template)
end
end
else
else
result = "This template is in the wrong namespace. It should be used within the Module namespace."
result = "This template or its settings is in the wrong namespace. It should be used within the Module namespace."
end
end


Line 146: Line 146:
result = "This module primarily serves as a library for other modules and has no corresponding template."
result = "This module primarily serves as a library for other modules and has no corresponding template."
else
else
result = "This template is in the wrong namespace. It should be used within the Module namespace."
result = "This template or its settings is in the wrong namespace. It should be used within the Module namespace."
end
end