Difference between revisions of "Module:Documentation"
hardcode image=none in fmbox
>Mr. Stradivarius (more comment tweaks) |
>Mr. Stradivarius (hardcode image=none in fmbox) |
||
Line 498: | Line 498: | ||
function p.makeStartBoxData(args, env, links) | function p.makeStartBoxData(args, env, links) | ||
--[=[ | |||
-- Does initial processing of data to pass to the start-box render function, p.renderStartBox. | |||
-- @args - a table of arguments passed by the user | |||
-- @env - environment table containing title objects, etc., generated with p.getEnvironment | |||
-- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error. | |||
-- | |||
-- Messages: | |||
-- 'documentation-icon-wikitext' --> '[[File:Template-info.png|50px|link=|alt=Documentation icon]]' | |||
-- 'template-namespace-heading' --> 'Template documentation' | |||
-- 'module-namespace-heading' --> 'Module documentation' | |||
-- 'file-namespace-heading' --> 'Summary' | |||
-- 'other-namespaces-heading' --> 'Documentation' | |||
-- 'start-box-linkclasses' --> 'mw-editsection plainlinks' | |||
-- 'start-box-link-id' --> 'doc_editlinks' | |||
--]=] | |||
local subjectSpace = env.subjectSpace | local subjectSpace = env.subjectSpace | ||
if not subjectSpace then | if not subjectSpace then | ||
Line 536: | Line 551: | ||
end | end | ||
-- [view][edit][history][purge] or [create] links. | -- Data for the [view][edit][history][purge] or [create] links. | ||
if links then | if links then | ||
data.linksClass = message('start-box-linkclasses') | data.linksClass = message('start-box-linkclasses') | ||
Line 548: | Line 563: | ||
function p.renderStartBox(data) | function p.renderStartBox(data) | ||
-- Renders the start box html. | -- Renders the start box html. | ||
-- @data - a table of data generated by p.makeStartBoxData. | |||
local sbox = htmlBuilder.create('div') | local sbox = htmlBuilder.create('div') | ||
sbox | sbox | ||
Line 576: | Line 592: | ||
function p._content(args, env) | function p._content(args, env) | ||
-- Displays the documentation contents | |||
-- @args - a table of arguments passed by the user | |||
-- @env - environment table containing title objects, etc., generated with p.getEnvironment | |||
local docTitle = env.docTitle | local docTitle = env.docTitle | ||
local content = args.content | local content = args.content | ||
Line 594: | Line 613: | ||
function p._endBox(args, env) | function p._endBox(args, env) | ||
--[[ | |||
-- This function generates the end box (also known as the link box). | -- This function generates the end box (also known as the link box). | ||
-- @args - a table of arguments passed by the user | |||
-- @env - environment table containing title objects, etc., generated with p.getEnvironment | |||
-- | |||
-- Messages: | |||
-- 'fmbox-id' --> 'documentation-meta-data' | |||
-- | |||
--]] | |||
-- Get environment data. | -- Get environment data. | ||
Line 620: | Line 647: | ||
local fmargs = {} | local fmargs = {} | ||
fmargs.id = message('fmbox-id') -- Sets 'documentation-meta-data' | fmargs.id = message('fmbox-id') -- Sets 'documentation-meta-data' | ||
fmargs.image = | fmargs.image = 'none' | ||
fmargs.style = message('fmbox-style') -- Sets 'background-color: #ecfcf4' | fmargs.style = message('fmbox-style') -- Sets 'background-color: #ecfcf4' | ||
fmargs.textstyle = message('fmbox-textstyle') -- 'font-style: italic;' | fmargs.textstyle = message('fmbox-textstyle') -- 'font-style: italic;' |