Module:List: Difference between revisions

From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
replace "numbered" with "ordered"
(fix horizontal numbered list style)
(replace "numbered" with "ordered")
Line 1:
-- This module outputs different kinds of lists. At the moment, bulleted, unbulleted,
-- horizontal, numberedordered, and horizontal numberedordered lists are supported.
 
local p = {}
Line 41:
local function getClass(listType, class)
local classes = {}
if listType == 'horizontal' or listType == 'horizontal_numberedhorizontal_ordered' then
table.insert(classes, 'hlist')
elseif listType == 'unbulleted' then
Line 56:
local function getStyle(listType, indent, style)
local styles = {}
if listType == 'horizontal' or listType == 'horizontal_numberedhorizontal_ordered' then
indent = indent and tonumber(indent)
indent = tostring((indent and indent * 1.6) or 0)
Line 87:
local listTag = 'ul'
local startAttr, typeAttr
if listType == 'numberedordered' or listType == 'horizontal_numberedhorizontal_ordered' then
listTag = 'ol'
startAttr = args.start
Line 134:
end
 
local funcNames = {'bulleted', 'unbulleted', 'horizontal', 'numberedordered', 'horizontal_numberedhorizontal_ordered'}
 
for _, funcName in ipairs(funcNames) do
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu