Jump to content

Module:Exports

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by BrandonXLF (talk | contribs) at 05:16, 24 August 2024 (Module to show exports of string modules). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

local p = {}
local TableTools = require('Module:TableTools')

function p.exports(frame)
	local currentTitle = mw.title.getCurrentTitle()
	
	if currentTitle.contentModel ~= 'Scribunto' then
		return ''
	end
	
	local moduleExports = require(currentTitle.fullText)
	local keys = TableTools.keysToList(moduleExports)
	
	return 'Exported types: ' .. mw.text.listToText(keys)
end

return p