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').versions table.insert(html, ' \n') return table.concat(html) end

return p