Module:Infobox: Difference between revisions
Jump to navigation
Jump to search
JonasCuomo (talk | contribs) (Created page with "local p = {} local args = {} local origArgs = {} local root local empty_row_categories = {} local category_in_empty_row_pattern = '%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*]]' local has_rows = false local lists = { plainlist_t = { patterns = { '^plainlist$', '%splainlist$', '^plainlist%s', '%splainlist%s' }, found = false, styles = 'Plainlist/styles.css' }, hlist_t = { patterns = { '^hlist$', '%shlist$', '^hlist%s', '%shlist%s'...") |
(Replaced content with "-- This module implements the Infobox template. local p = {} function p.infobox(frame) local args = frame.args local title = args.title or '' local image = args.image or '' local caption = args.caption or '' local body = args.body or '' local output = '' output = output .. '<table class="infobox">\n' output = output .. '<caption>' .. title .. '</caption>\n' if image ~= '' then output = output .. '<tr>\n<td colspan="2"...") Tag: Replaced |
||
Line 1: | Line 1: | ||
-- This module implements the Infobox template. | |||
local p = {} | local p = {} | ||
function p.infobox(frame) | |||
local args = frame.args | |||
local title = args.title or '' | |||
local image = args.image or '' | |||
local caption = args.caption or '' | |||
local body = args.body or '' | |||
local | |||
local | |||
local | |||
local | |||
local output = '' | |||
output = output .. '<table class="infobox">\n' | |||
output = output .. '<caption>' .. title .. '</caption>\n' | |||
if image ~= '' then | |||
output = output .. '<tr>\n<td colspan="2" style="text-align:center"><img src="' .. image .. '" alt="' .. caption .. '"></td>\n</tr>\n' | |||
end | |||
end | |||
if body ~= '' then | |||
output = output .. '<tr>\n<td colspan="2">' .. body .. '</td>\n</tr>\n' | |||
end | |||
end | |||
output = output .. '</table>' | |||
return output | |||
end | end | ||
return p | return p |
Revision as of 22:29, 3 May 2023
Documentation for this module may be created at Module:Infobox/doc
-- This module implements the Infobox template. local p = {} function p.infobox(frame) local args = frame.args local title = args.title or '' local image = args.image or '' local caption = args.caption or '' local body = args.body or '' local output = '' output = output .. '<table class="infobox">\n' output = output .. '<caption>' .. title .. '</caption>\n' if image ~= '' then output = output .. '<tr>\n<td colspan="2" style="text-align:center"><img src="' .. image .. '" alt="' .. caption .. '"></td>\n</tr>\n' end if body ~= '' then output = output .. '<tr>\n<td colspan="2">' .. body .. '</td>\n</tr>\n' end output = output .. '</table>' return output end return p