Modul:List: Unterschied zwischen den Versionen

replace "numbered" with "ordered"
(fix horizontal numbered list style)
(replace "numbered" with "ordered")
Zeile 1: Zeile 1:
-- This module outputs different kinds of lists. At the moment, bulleted, unbulleted,
-- This module outputs different kinds of lists. At the moment, bulleted, unbulleted,
-- horizontal, numbered, and horizontal numbered lists are supported.
-- horizontal, ordered, and horizontal ordered lists are supported.


local p = {}
local p = {}
Zeile 41: Zeile 41:
local function getClass(listType, class)
local function getClass(listType, class)
local classes = {}
local classes = {}
if listType == 'horizontal' or listType == 'horizontal_numbered' then
if listType == 'horizontal' or listType == 'horizontal_ordered' then
table.insert(classes, 'hlist')
table.insert(classes, 'hlist')
elseif listType == 'unbulleted' then
elseif listType == 'unbulleted' then
Zeile 56: Zeile 56:
local function getStyle(listType, indent, style)
local function getStyle(listType, indent, style)
local styles = {}
local styles = {}
if listType == 'horizontal' or listType == 'horizontal_numbered' then
if listType == 'horizontal' or listType == 'horizontal_ordered' then
indent = indent and tonumber(indent)
indent = indent and tonumber(indent)
indent = tostring((indent and indent * 1.6) or 0)
indent = tostring((indent and indent * 1.6) or 0)
Zeile 87: Zeile 87:
local listTag = 'ul'
local listTag = 'ul'
local startAttr, typeAttr
local startAttr, typeAttr
if listType == 'numbered' or listType == 'horizontal_numbered' then
if listType == 'ordered' or listType == 'horizontal_ordered' then
listTag = 'ol'
listTag = 'ol'
startAttr = args.start
startAttr = args.start
Zeile 134: Zeile 134:
end
end


local funcNames = {'bulleted', 'unbulleted', 'horizontal', 'numbered', 'horizontal_numbered'}
local funcNames = {'bulleted', 'unbulleted', 'horizontal', 'ordered', 'horizontal_ordered'}


for _, funcName in ipairs(funcNames) do
for _, funcName in ipairs(funcNames) do
Anonymer Benutzer