Difference between revisions 51806 and 51807 on wikimaniawiki

-- This module implements {{documentation}}.

-- Get required modules.
local getArgs = require('Module:Arguments').getArgs
local htmlBuilder = require('Module:HtmlBuilder')
local messageBox = require('Module:Message box')

-- Get the config table.
(contracted; show full)function p._startBox(args, env)
	-- Generate [view][edit][history][purge] or [create] links.
	local links
	local content = args.content
	if not content then
		-- No need to include the links if the documentation is on the template page itself.
		local linksData = p.makeStartBoxLinksData(args, env)
		if 
type(linksData) == 'table' then
			links = p.renderStartBoxLinks(linksData)
		else
			-- linksData is nil or an error message.
			return linksData
		end
	end
	-- Generate the start box html.
	local data = p.makeStartBoxData(args, env, links)
	if type(data) == 'table' then
		return p.renderStartBox(data)
	elseif type(data) == 'string' then
		-- data is an error message.
(contracted; show full)
		local sort = (title.namespace == 0 and message('strangeUsageCategoryMainspaceSort', 'string') or '') .. title.prefixedText -- Sort on namespace.
		ret = ret .. makeCategoryLink(message('strangeUsageCategory', 'string'), sort)
	end
	return ret
end

return p