Module:Convert/text: Difference between revisions

improve some comments
(fix an incorrect comment and add extra comments)
(improve some comments)
Line 43:
}
 
-- Names when using engineering notation (a prefix of "eN" where N is a number; example "e6km").
-- key = { "name", link = "article title", exponent = keynumeric_key_value }
-- If lk=on and link is defined, the name of the number will appear as a link.
local eng_scales = {
Line 54:
}
 
-- WhenOne appropriate,of the following categories can beis included in the outputtext of each error or warning message.
local all_categories = {
general = "[[Category:Convert error]]",
Line 62:
}
 
-- For some error messages, the following puts the wanted style around
-- Following puts wanted style around each unit code marked like '...%{ft%}...'.
local unitcode_regex = '%%([{}])'
local unitcode_replace = { ['{'] = '<code style="background:transparent;">', ['}'] = '</code>' }
Line 73 ⟶ 74:
-- Each of following messages is a table:
-- { [1] = 'error text',
-- [2] = 'category key', -- key to lookup category in all_categories
-- regex = gsub_regex,
-- replace = gsub_table,
Line 114 ⟶ 115:
-- Text to separate values in a range.
local range_types = {
-- Specifying a table requires "off" and "on" values (for "abbr=off" and "abbr=on");
-- other fields are optional.
-- Normally, "adj=on" uses hyphens with unabbreviated units (names, not symbols).
-- However, "exception = true" means hyphens are also used with "adj=on|abbr=on".
-- If "adj" is defined here, that text is used with "adj=on" (without hyphens).
["+"] = " + ",
[","] = ",&nbsp;",
Line 132 ⟶ 138:
 
local range_aliases = {
-- ["alternative name for a range"] = "standard range name"
["and(-)"] = "and",
["&"] = "and",
Line 242 ⟶ 249:
["in"] = "in", -- link LHS unit name or symbol
["off"] = "", -- ignored (off is the default)
["on"] = "on", -- link all unit names or symbols (but not twice tofor the same unit)
["out"] = "out", -- link RHS unit name or symbol
},
Anonymous user