Module:Al version

local p = {}

-- Raw version function p.al_version(f) local args = f   if f == mw.getCurrentFrame then args = require('Module:ProcessArgs' ).merge(true) end local version = mw.text.trim( args[1] or '' ) -- load the values from the submodule local version_data = mw.loadData('Module:al_version/Versions').versions[version] local category = '' local value local title = mw.title.getCurrentTitle if version_data then if version_data.ver then if version_data.ver == 'Unknown' then value = 'Unknown' if not args.nocat and title.namespace == 0 and not title.isSubpage then category = '' end else value = version_data.ver end else value = 'N/A' end else value = 'Pending' if not args.nocat and title.namespace == 0 and not title.isSubpage then category = '' end end return value .. category end

-- Version table function p.table(f) local args = f   if f == mw.getCurrentFrame then args = require('Module:ProcessArgs').merge(true) end local html = {} local values = mw.loadData('Module:al_version/Versions').list function table_header table.insert(html, ' ') table.insert(html, '\n===Indev and Infdev===\n') table_header end table.insert(html, ' \n') table.insert(html, ' ' .. version.name .. ' ') table.insert(html, ' ' .. version.ver .. ' ') table.insert(html, ' ') end table.insert(html, ' ') return table.concat(html) end

return p