Documentation for this module may be created at Module:Sugar Drop levels/doc

-- based on Module:Hexagon levels page

-- <nowiki>
local p = {}
 
local _lookupTable = 'Module:Sugar Drop levels/List'
 
local sugardropTag = 'Sugar Drop'
 
local function _lookupSugarDropStatus( levelName )
	if levelName and not (levelName == '') then
    	local level = levelName:match('^Level (%d+)')
    	if level then 
            local data = mw.loadData( _lookupTable )
            return data[tonumber(level)]
        end
    end
    return false
end

function p.sugardrop()
    local sdstatus = _lookupSugarDropStatus(mw.title.getCurrentTitle().text)
    local cat = ''
    if sdstatus == sugardropTag then
        cat = "[[Category:Sugar Drop levels]]"
    end
    return cat
end

function p.sugardropinfobox(frame)
	local name = frame.args[1]
	local icon = ''
    if _lookupSugarDropStatus(name) == sugardropTag then
          icon = "Ⓒ"
	 end
	 return icon
end

return p
-- </nowiki>
Community content is available under CC-BY-SA unless otherwise noted.