Module:Exports: Difference between revisions
Appearance
Content deleted Content added
BrandonXLF (talk | contribs) Module to show exports of string modules |
BrandonXLF (talk | contribs) Wrap in <code> |
||
Line 11: | Line 11: | ||
local moduleExports = require(currentTitle.fullText) |
local moduleExports = require(currentTitle.fullText) |
||
local keys = TableTools.keysToList(moduleExports) |
local keys = TableTools.keysToList(moduleExports) |
||
local outputKeys = {} |
|||
for i, v in ipairs(keys) do |
|||
⚫ | |||
outputKeys[i] = '<code>' .. v .. '</code>' |
|||
end |
|||
⚫ | |||
end |
end |
||
Revision as of 05:20, 24 August 2024
![]() | This module is rated as ready for general use. It has reached a mature form and is thought to be relatively bug-free and ready for use wherever appropriate. It is ready to mention on help pages and other Wikipedia resources as an option for new users to learn. To reduce server load and bad output, it should be improved by 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