Difference between revisions of "Module:Test"
Jump to navigation
Jump to search
m (Hmmmmm) |
m (This is going to be much harder than it looks) |
||
| (25 intermediate revisions by the same user not shown) | |||
| Line 8: | Line 8: | ||
end | end | ||
--return "<nowiki>" .. (args[1] or "") .. "</nowiki>" | --[[return "<nowiki>" .. (args[1] or "") .. "</nowiki>" | ||
if args[1] == nil then | if args[1] == nil then | ||
return "Nothing :S" | return "Nothing :S" | ||
| Line 15: | Line 15: | ||
return string.match(args[1], '.+#%d+.+') | return string.match(args[1], '.+#%d+.+') | ||
else | else | ||
return args[1] | return string.sub(args[1], 2, -1) | ||
end]] | |||
if args.title ~= nil then | |||
args.title = "\'\'\'" .. args.title .. "\'\'\'" | |||
else | |||
args.title = "" | |||
end | |||
if args.date ~= nil then | |||
args.date = ":" .. args.date | |||
else | |||
args.date = "" | |||
end | end | ||
return args.title .. "\n" .. args.date | |||
end | |||
function p.get( f ) | |||
local rss = f:expandTemplate{ title='User:Chocohead/RSS-Latest'} | |||
return rss | |||
end | end | ||
return p | return p | ||
Latest revision as of 18:34, 18 February 2015
Documentation for this module may be created at Module:Test/doc
local p = {}
function p.rss( f )
local args = f
if f == mw.getCurrentFrame() then
args = f:getParent().args
end
--[[return "<nowiki>" .. (args[1] or "") .. "</nowiki>"
if args[1] == nil then
return "Nothing :S"
end
if(args[1]:find("#")) then
return string.match(args[1], '.+#%d+.+')
else
return string.sub(args[1], 2, -1)
end]]
if args.title ~= nil then
args.title = "\'\'\'" .. args.title .. "\'\'\'"
else
args.title = ""
end
if args.date ~= nil then
args.date = ":" .. args.date
else
args.date = ""
end
return args.title .. "\n" .. args.date
end
function p.get( f )
local rss = f:expandTemplate{ title='User:Chocohead/RSS-Latest'}
return rss
end
return p