Модуль:Infobox
Версия от 15:05, 3 июля 2018; Alexandre (обсуждение | вклад) (Новая страница: «local p = {}; function p.renderLine( frame ) local args = frame:getParent().args; if args[ 'заголовок' ] and args[ 'заголовок' ] ~= '' then…»)
Для документации этого модуля может быть создана страница Модуль:Infobox/doc
local p = {}; function p.renderLine( frame ) local args = frame:getParent().args; if args[ 'заголовок' ] and args[ 'заголовок' ] ~= '' then local style = ( args[ 'стиль_заголовков' ] or '' ) .. ( args[ 'стиль_заголовка' ] or '' ); return '\n<tr>\n<th colspan="2" style="text-align:center;' .. style .. '">' .. args[ 'заголовок' ] .. '</th>\n</tr>'; end local text = args[ 'текст' ] or ''; if args[ 'викиданные' ] and args[ 'викиданные' ] ~= '' then text = frame:expandTemplate{ title = 'Wikidata', args = { args[ 'викиданные' ], text, from = args[ 'from' ] or '' } }; end if text ~= '' then local label = args[ 'метка' ] or ''; local class = args[ 'класс' ] or ''; if class ~= 'noplainlist' then class = class .. ' plainlist'; end if class ~= '' then class = ' class="' .. class .. '"'; end local style = ( args[ 'стиль_текстов' ] or '' ) .. ( args[ 'стиль_текста' ] or '' ); if label == '' then style = 'text-align:center;' .. style; end if style ~= '' then style = ' style="' .. style .. '"'; end if label ~= '' then local labelClass = args[ 'класс_меток' ] or ''; if labelClass ~= 'noplainlist' then labelClass = labelClass .. ' plainlist'; end if labelClass ~= '' then labelClass = ' class="' .. labelClass .. '"'; end local labelStyle = ( args[ 'стиль_меток' ] or '' ) .. ( args[ 'стиль_метки' ] or '' ); if labelStyle ~= '' then labelStyle = ' style="' .. labelStyle .. '"'; end return '\n<tr>\n<th' .. 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 ''; end return p;