Module:MOS modes: Difference between revisions

Ganaram inukshuk (talk | contribs)
todo
Ganaram inukshuk (talk | contribs)
force-collapse, following nick vucis recommendation on not sponsoring mode names
 
(18 intermediate revisions by the same user not shown)
Line 10: Line 10:
-- TODO:
-- TODO:
-- - Add ability to autocollapse on large mos pages (say, more than 12 modes)
-- - Add ability to autocollapse on large mos pages (say, more than 12 modes)
-- - Drop/replace delimiter-based mode name input; it's harder to maintain


-- "Main" function
-- "Main" function
-- To be called by wrapper
-- To be called by wrapper
function p._mos_modes(input_mos, mode_names, headers, entries, is_collapsed)
function p._mos_modes(input_mos, mode_names, headers, entries, is_collapsed)
local is_collapsed = is_collapsed == true
local is_collapsed = true
local input_mos = input_mos or mos.new(5,2)
local input_mos = input_mos or mos.new(5,2)
local mode_names = mode_names or {}
local mode_names = mode_names or {}
Line 29: Line 28:


-- Check whether to add mode names
-- Check whether to add mode names
--local add_mode_names = #mode_names == #mos_modes
local add_mode_names = #mode_names == #mos_modes
local add_mode_names = false


-- Check whether the number of headers times the number of modes equals the
-- Check whether the number of headers times the number of modes equals the