Модуль:Infobox

Для документации этого модуля может быть создана страница Модуль:Infobox/doc

local p = {};local yesno = require('Module:Yesno')local function _renderLine( frame, args, i )if args[ 'заголовок' .. i ] and args[ 'заголовок' .. i ] == '-' thenreturn ''elseif args[ 'заголовок' .. i ] and args[ 'заголовок' .. i ] ~= '' thenlocal style = ( args[ 'стиль_заголовков' ] or '' ) .. ( args[ 'стиль_заголовка' .. i ] or '' );local class = ( args[ 'класс' .. i ] or '' );return '\n<tr>\n<th colspan="2" scope="colgroup" class="infobox-header ' .. class .. '" style="' .. style .. '">' ..args[ 'заголовок' .. i ] ..'</th>\n</tr>';endif args[ 'блок' .. i ] and args[ 'блок' .. i ] ~= '' thenreturn args[ 'блок' .. i ];endlocal text = args[ 'текст' .. i ] or '';if args[ 'викиданные' .. i ] and args[ 'викиданные' .. i ] ~= '' thentext = frame:expandTemplate{ title = 'Wikidata', args = {args[ 'викиданные' .. i ],text,from = args[ 'from' ] or ''} };end    if text ~= '' thenlocal label = args[ 'тамга' .. i ] or '';    local class = args[ 'класс' .. i ] or '';    if string.find(class, 'noplainlist') == nil and string.find(class, 'nofirstlevel') == nil then    class = class .. ' plainlist';    end    if class ~= '' thenclass = ' class="' .. class .. '"';    end    local style = ( args[ 'стиль_текстов' ] or '' ) .. ( args[ 'стиль_текста' ] or '' ) .. ( args[ 'стиль_текста' .. i ] or '' );if label == '' thenstyle = 'text-align:center;' .. style;end    if style ~= '' then    style = ' style="' .. style .. '"';endif label ~= '' then    local labelClass = args[ 'класс_меток' ] or '';    if string.find(labelClass, 'noplainlist') == nil and string.find(labelClass, 'nofirstlevel') == nil then    labelClass = labelClass .. ' plainlist';end    if labelClass ~= '' then    labelClass = ' class="' .. labelClass .. '"';end    local labelStyle = ( args[ 'стиль_меток' ] or '' ) .. ( args[ 'стиль_метки' .. i ] or '' );    if labelStyle ~= '' then    labelStyle = ' style="' .. labelStyle .. '"';endreturn '\n<tr>\n<th scope="row"' .. labelClass .. labelStyle .. '>' .. label .. '</th>' ..    '\n<td' .. class .. style .. '>\n' .. text .. '</td>\n</tr>';end    return '\n<tr>\n<td colspan="2"' .. class .. style .. '>\n' .. text .. '</td>\n</tr>';end        return '';endlocal function maxNumber ( args )local maxNumber = 0for argName, _ in pairs(args) dolocal argNumber = mw.ustring.match(argName, '^[^0-9]+([0-9]+)$')if argNumber and tonumber(argNumber) > maxNumber thenmaxNumber = tonumber(argNumber)endendreturn maxNumberendfunction p.renderLine( frame )local args = frame:getParent().args;return _renderLine(frame, args, '')endfunction p.renderLines( frame )local args = frame:getParent().args;local res = ''local header, text = '', ''local autoHeaders = yesno(args [ 'автозаголовки' ] or 'false', false)for i = 1, maxNumber(args) doif args[ 'заголовок' .. i ] and args[ 'заголовок' .. i ] ~= '' thenif text ~= '' or not autoHeaders thenres = res .. header .. textendheader, text = _renderLine(frame, args, i), ''elsetext = text .. _renderLine(frame, args, i)endendif text ~= '' or not autoHeaders thenres = res .. header .. textendreturn resendreturn p;