Difference between revisions of "Module:Sandbox/Andy M. Wang"
Jump to navigation
Jump to search
blackwiki>Andy M. Wang m (??) |
blackwiki>Andy M. Wang m (print?) |
||
| Line 17: | Line 17: | ||
function p._for(titleText, ...) | function p._for(titleText, ...) | ||
| − | + | for k, v in pairs(arg) do print(k,v) end | |
| − | + | --local links = mHatnote.formatPages(...) | |
| − | + | --links = mw.text.listToText(links) | |
| − | + | --local text = 'For ' .. links | |
| − | + | --return mHatnote._hatnote(text) | |
| − | |||
| − | |||
| − | local links = mHatnote.formatPages(...) | ||
| − | links = mw.text.listToText(links) | ||
| − | local text = 'For ' .. links | ||
| − | return mHatnote._hatnote(text) | ||
end | end | ||
return p | return p | ||
Revision as of 06:22, 1 May 2016
local mHatnote = require('Module:Hatnote')
local mArguments -- lazily initialise
local p = {}
function p.forfun(frame)
mArguments = require('Module:Arguments')
local args = mArguments.getArgs(frame, {parentOnly = true})
local pages = {}
for k, v in pairs(args) do
if type(k) == 'number' then
pages[k] = v
end
end
return p._for(mw.title.getCurrentTitle().text, unpack(pages))
end
function p._for(titleText, ...)
for k, v in pairs(arg) do print(k,v) end
--local links = mHatnote.formatPages(...)
--links = mw.text.listToText(links)
--local text = 'For ' .. links
--return mHatnote._hatnote(text)
end
return p