Модуль:UtilsHTML
Материал из Eco - Русская Wiki
Для документации этого модуля может быть создана страница Модуль:UtilsHTML/doc
local p = {}
--- Create HTML <code>abbr</code>-tag (abbreviation).
-- @param #string abbreviation The abbreviation (visible text)
-- @param #string title Explanation of the abbreviation (show in tooltip when hovered)
-- @return #string HTML code: "<abbr title="<code>abbreviation</code>"><code>text</code></abbr>"
-- @author User:Demian
function p.tagAbbr(abbreviation, title)
-- Cast to string to avoid errors from using the format string.
return mw.ustring.format("<abbr style=\"text-decoration: underline dotted 0.0625em;\" title=\"%s\">%s</abbr>", tostring(title), tostring(abbreviation))
end
--- Create HTML code for table with two cells on the same row.
--
-- Intended for displaying two pieces of content side-by-side.
-- @param #string leftCell Content in left cell
-- @param #string rightCell Content in right cell
-- @return #string HTML code for a table with the specified content.
-- @author User:Demian
function p.twoCellTable(leftCell, rightCell)
return mw.ustring.format("<table><tr><td>%s</td><td>%s</td></tr></table>", leftCell, rightCell)
end
return p