Module:UtilsHTML/doc: Difference between revisions

From Eco - English Wiki
[unchecked revision][checked revision]
(Created page with "This module provides utility functions that generate HTML code. They are used to shorten and make code in other modules more readable by providing functions to generate frequently used pieces of HTML code such as an [https://developer.mozilla.org/en-US/docs/Web/HTML/Element/abbr abbr]-tag or a unit of measure text like "ppm" (with an abbreviation tag that shows the name of the unit). == Usage == Add the following line of code at the top of your file. <syntaxhighlight l...")
 
m (Add category.)
 
Line 8: Line 8:
-- You may then call functions from this module in your script. For example:
-- You may then call functions from this module in your script. For example:
local unitKM = HTMLUtils.tagAbbr("km", "kilometers")</syntaxhighlight>
local unitKM = HTMLUtils.tagAbbr("km", "kilometers")</syntaxhighlight>
[[Category: WikiModules]]

Latest revision as of 16:43, 22 February 2022

This module provides utility functions that generate HTML code. They are used to shorten and make code in other modules more readable by providing functions to generate frequently used pieces of HTML code such as an abbr-tag or a unit of measure text like "ppm" (with an abbreviation tag that shows the name of the unit).

Usage[edit source]

Add the following line of code at the top of your file.

local HTMLUtils = require("Module:UtilsHTML")

-- You may then call functions from this module in your script. For example:
local unitKM = HTMLUtils.tagAbbr("km", "kilometers")