Module:List and Module:Transclusion count/data/H: Difference between pages

From Frontierpedia, the Microsoft Agent encyclopedia
(Difference between pages)
en>Mr. Stradivarius
(convert to Module:HtmlBuilder and fix list-style-type support)
 
en>Ahechtbot
m (Bot: Updated page.)
 
Line 1: Line 1:
-- This module outputs different kinds of lists. At the moment, bulleted, unbulleted,
return {
-- horizontal, ordered, and horizontal ordered lists are supported.
["H-phrases"] = 2200,
 
["H-phrases/text"] = 2200,
local p = {}
["HABS"] = 2100,
 
["HDS"] = 4100,
local htmlBuilder = require('Module:HtmlBuilder')
["HD_color"] = 2800,
 
["HKG"] = 2800,
local function getListItem(data, style, itemStyle)
["HMAS"] = 6700,
if not data then
["HMCS"] = 4400,
return nil
["HMM"] = 5000,
end
["HMNZS"] = 2100,
local item = htmlBuilder.create('li')
["HMS"] = 33000,
item
["HOUR"] = 2300,
.cssText(style)
["HRV"] = 4200,
.cssText(itemStyle)
["HUN"] = 9700,
.wikitext(data)
["Hab"] = 11000,
return tostring(item)
["Hair_space"] = 8400,
end
["Hansard-contribs"] = 9300,
 
["Harv"] = 5800,
local function getArgNums(args)
["Harvard_citation"] = 6300,
-- Returns an array containing the keys of all positional arguments
["Harvard_citation_no_brackets"] = 39000,
-- that contain data (i.e. non-whitespace values).
["Harvard_citation_text"] = 5300,
local nums = {}
["Harvid"] = 54000,
for k, v in pairs(args) do
["Harvnb"] = 38000,
if type(k) == 'number' and
["Harvp"] = 3100,
k >= 1 and
["Harvtxt"] = 5300,
math.floor(k) == k and
["Has_short_description"] = 195000,
mw.ustring.match(v, '%S') then
["Hat"] = 11000,
table.insert(nums, k)
["Hatnote"] = 421000,
end
["Hatnote_inline"] = 3200,
end
["Hatnote_inline/invoke"] = 3200,
table.sort(nums)
["Height"] = 105000,
return nums
["Help_me-helped"] = 14000,
end
["Helpbox"] = 2500,
 
["Helpbox/styles.css"] = 2500,
function p.makeList(listType, args)
["Helpme-helped"] = 2100,
-- This is the main function to be called from other Lua modules.
["Hidden"] = 348000,
-- First, get the list items.
["Hidden/FC"] = 3700,
local listItems = {}
["Hidden_archive_bottom"] = 11000,
local argNums = getArgNums(args)
["Hidden_archive_top"] = 11000,
for i, num in ipairs(argNums) do
["Hidden_begin"] = 383000,
local item = getListItem(
["Hidden_category"] = 6200,
args[num],
["Hidden_end"] = 383000,
args.item_style or args.li_style, -- li_style is included for backwards compatibility. item_style was included to be easier to understand for non-coders.
["Hidden_ping"] = 3200,
args['item_style' .. tostring(num)] or args['li_style' .. tostring(num)]
["Hidden_sort_key"] = 16000,
)
["Hide_in_print"] = 61000,
table.insert(listItems, item)
["High-Class"] = 15000,
end
["High-importance"] = 15000,
if #listItems == 0 then
["High-use"] = 3200,
return ''
["Highlight"] = 4800,
end
["Highlight/core"] = 4900,
-- Build the list html.
["Hilite"] = 2800,
local root = htmlBuilder.create('div')
["Historical"] = 25000,
if listType == 'horizontal' or listType == 'horizontal_ordered' then
["Historical_populations"] = 35000,
root.addClass('hlist')
["History_icon"] = 9300,
elseif listType == 'unbulleted' then
["History_icon2"] = 9300,
root.addClass('plainlist')
["Hlist"] = 179000,
end
["Hmbox"] = 22000,
root.addClass(args.class)
["Hmmm"] = 5900,
if listType == 'horizontal' or listType == 'horizontal_ordered' then
["Hndis"] = 62000,
local indent = args.indent and tonumber(indent)
["HockeyDB"] = 3700,
indent = tostring((indent and indent * 1.6) or 0)
["Hockeydb"] = 3600,
root.css('margin-left', indent .. 'em')
["Hong_Kong_English"] = 2900,
end
["Horizontal_TOC"] = 4700,
root.cssText(args.style)
["Horizontal_TOC/styles.css"] = 4700,
local list = root.tag((listType == 'ordered' or listType == 'horizontal_ordered') and 'ol' or 'ul')
["Horse_racing"] = 3300,
list
["HoursElapsed"] = 41000,
.attr('start', args.start)
["Hours_elapsed"] = 41000,
.attr('type', args.type)
["Hover_title"] = 54000,
.css('list-style-type', args['list-style-type'])
["How_to_request_photo_in"] = 2200,
.cssText(args.list_style or args.ul_style or args.ol_style) -- ul_style and ol_style are included for backwards compatibility. No distinction is made for ordered or unordered lists.
["Howtoreqphotoin"] = 2100,
.wikitext(table.concat(listItems))
["Hr"] = 4400,
return tostring(root)
["Hs"] = 16000,
end
["Hsp"] = 3400,
 
["Hugman"] = 6700,
local function makeWrapper(listType)
["Human_name_disambiguation"] = 65000,
return function(frame)
["Humor"] = 2400,
local origArgs
["Hurricane"] = 2600,
if frame == mw.getCurrentFrame() then
["Hurricane_season_bar"] = 2300,
origArgs = frame:getParent().args
["Hurricane_season_bar/button"] = 2300,
for k, v in pairs(frame.args) do
["Hurricane_season_bar/end"] = 2300,
origArgs = frame.args
["Hurricane_season_bar/start"] = 2300,
break
["Hurricane_status_small"] = 2300,
end
["Module:HTMLDecode"] = 598000,
else
["Module:Hatnote"] = 1530000,
origArgs = frame
["Module:Hatnote_inline"] = 3200,
end
["Module:Hatnote_list"] = 969000,
["Module:Hidden_ping"] = 3200,
local args = {}
["Module:High-use"] = 3600,
for k, v in pairs(origArgs) do
["Module:Highest_archive_number"] = 106000,
if type(k) == 'number' or v ~= '' then
["Module:Historical_populations"] = 35000,
args[k] = v
["Module:Hms"] = 226000,
end
}
end
return p.makeList(listType, args)
end
end
 
local funcNames = {'bulleted', 'unbulleted', 'horizontal', 'ordered', 'horizontal_ordered'}
 
for _, funcName in ipairs(funcNames) do
p[funcName] = makeWrapper(funcName)
end
 
return p

Revision as of 05:11, 23 May 2021

Documentation for this module may be created at Module:Transclusion count/data/H/doc

return {
["H-phrases"] = 2200,
["H-phrases/text"] = 2200,
["HABS"] = 2100,
["HDS"] = 4100,
["HD_color"] = 2800,
["HKG"] = 2800,
["HMAS"] = 6700,
["HMCS"] = 4400,
["HMM"] = 5000,
["HMNZS"] = 2100,
["HMS"] = 33000,
["HOUR"] = 2300,
["HRV"] = 4200,
["HUN"] = 9700,
["Hab"] = 11000,
["Hair_space"] = 8400,
["Hansard-contribs"] = 9300,
["Harv"] = 5800,
["Harvard_citation"] = 6300,
["Harvard_citation_no_brackets"] = 39000,
["Harvard_citation_text"] = 5300,
["Harvid"] = 54000,
["Harvnb"] = 38000,
["Harvp"] = 3100,
["Harvtxt"] = 5300,
["Has_short_description"] = 195000,
["Hat"] = 11000,
["Hatnote"] = 421000,
["Hatnote_inline"] = 3200,
["Hatnote_inline/invoke"] = 3200,
["Height"] = 105000,
["Help_me-helped"] = 14000,
["Helpbox"] = 2500,
["Helpbox/styles.css"] = 2500,
["Helpme-helped"] = 2100,
["Hidden"] = 348000,
["Hidden/FC"] = 3700,
["Hidden_archive_bottom"] = 11000,
["Hidden_archive_top"] = 11000,
["Hidden_begin"] = 383000,
["Hidden_category"] = 6200,
["Hidden_end"] = 383000,
["Hidden_ping"] = 3200,
["Hidden_sort_key"] = 16000,
["Hide_in_print"] = 61000,
["High-Class"] = 15000,
["High-importance"] = 15000,
["High-use"] = 3200,
["Highlight"] = 4800,
["Highlight/core"] = 4900,
["Hilite"] = 2800,
["Historical"] = 25000,
["Historical_populations"] = 35000,
["History_icon"] = 9300,
["History_icon2"] = 9300,
["Hlist"] = 179000,
["Hmbox"] = 22000,
["Hmmm"] = 5900,
["Hndis"] = 62000,
["HockeyDB"] = 3700,
["Hockeydb"] = 3600,
["Hong_Kong_English"] = 2900,
["Horizontal_TOC"] = 4700,
["Horizontal_TOC/styles.css"] = 4700,
["Horse_racing"] = 3300,
["HoursElapsed"] = 41000,
["Hours_elapsed"] = 41000,
["Hover_title"] = 54000,
["How_to_request_photo_in"] = 2200,
["Howtoreqphotoin"] = 2100,
["Hr"] = 4400,
["Hs"] = 16000,
["Hsp"] = 3400,
["Hugman"] = 6700,
["Human_name_disambiguation"] = 65000,
["Humor"] = 2400,
["Hurricane"] = 2600,
["Hurricane_season_bar"] = 2300,
["Hurricane_season_bar/button"] = 2300,
["Hurricane_season_bar/end"] = 2300,
["Hurricane_season_bar/start"] = 2300,
["Hurricane_status_small"] = 2300,
["Module:HTMLDecode"] = 598000,
["Module:Hatnote"] = 1530000,
["Module:Hatnote_inline"] = 3200,
["Module:Hatnote_list"] = 969000,
["Module:Hidden_ping"] = 3200,
["Module:High-use"] = 3600,
["Module:Highest_archive_number"] = 106000,
["Module:Historical_populations"] = 35000,
["Module:Hms"] = 226000,
}