Module:Exports
Appearance
| This module is rated as ready for general use. It has reached a mature state, is considered relatively stable and bug-free, and may be used wherever appropriate. It can be mentioned on help pages and other Wikipedia resources as an option for new users. To minimise server load and avoid disruptive output, improvements should be developed through sandbox testing rather than repeated trial-and-error editing. |
| This module depends on the following other modules: |
Exports the exports function for use by Template:Module exports.
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)
local outputKeys = {}
for i, v in ipairs(keys) do
outputKeys[i] = '<code>' .. v .. '</code>'
end
return mw.text.listToText(outputKeys)
end
return p