Module:Dependencies

local p = {}

local i18n = { doc_subpage = 'doc', module_namespace = 'Module', no_results_text = 'None', results_header = 'Dependencies', error_module_empty = 'The module appears to be empty', }

function p.main local module_text = mw.title.getCurrentTitle.basePageTitle:getContent assert(module_text, i18n.error_module_empty) local requirements = {} for require in string.gmatch(module_text, 'require%(%s*["\'](.-)["\']%s*%)') do   if string.sub(require, 1, #i18n.module_namespace) == i18n.module_namespace then requirements[require] = true end end

if next(requirements) then local output = '==' .. i18n.results_header .. '==\n' for k,_ in pairs(requirements) do     output = output .. '* ' .. k .. '\n' end return output end end

return p