Module:columns/auto

Hello, you have come here looking for the meaning of the word Module:columns/auto. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:columns/auto, but we will also tell you about its etymology, its characteristics and you will know how to say Module:columns/auto in singular and plural. Everything you need to know about the word Module:columns/auto you have here. The definition of the word Module:columns/auto will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:columns/auto, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.


-- TODO needs a complete redesign

local export = {}

function export.decide_number_of_columns(number_of_items)
	if number_of_items <= 3 then
		return 1
	elseif number_of_items <= 9 then
		return 2
	elseif number_of_items <= 27 then
		return 3
	elseif number_of_items <= 81 then
		return 4
	else
		return 5
	end
end

function export.display_from(column_args, list_args)
	if not column_args then
		local m_table = require("Module:table")
		column_args = m_table.shallowcopy(column_args)
		column_args.columns = export.decide_number_of_columns(m_table.length(list_args))
	end
	return require("Module:columns").display_from(column_args, list_args)
end

function export.display(frame)
	return export.display_from(frame.args, frame:getParent().args)
end

return export