開啟主選單

求真百科

變更

模块:List

增加 198 位元組, 5 年前
xfer from sandbox per edit request on talk page
data.classes = {}
if listType == 'horizontal' or listType == 'horizontal_ordered' then
table.insert(data.classes, 'hlisthlist-separated')
elseif listType == 'unbulleted' then
table.insert(data.classes, 'plainlist')
item.style = args['item' .. tostring(num) .. '_style']
or args['item_style' .. tostring(num)]
or args['li_style' .. tostring(num)]
item.value = args['item' .. tostring(num) .. '_value']
or args['item_value' .. tostring(num)]
or args['li_value' .. tostring(num)]
table.insert(data.items, item)
end
local ret = ''
if isDeprecated then
ret = ret .. '[[Category: 含有过期参数的列表模板List templates with deprecated parameters]]'
end
return ret
if not listType or not listTypes[listType] then
error(string.format(
"bad argument #1 to 'makeList' ('%s' 不是合适的列表类型is not a valid list type)",
tostring(listType)
), 2)
p[listType] = function (frame)
local mArguments = require('Module:Arguments')
local origArgs = mArguments.getArgs(frame, { valueFunc = function (key, value) if not value or not mw.ustring.find(value, '%S') then return nil end if mw.ustring.find(value, '^%s*[%*#;:]') then return value else return value:match('^%s*(.-)%s*$') end return nil end })
-- Copy all the arguments to a new table, for faster indexing.
local args = {}