No edit summary Tag: Manual revert |
No edit summary |
||
Line 11: | Line 11: | ||
container:node(date) | container:node(date) | ||
end | end | ||
if args._pageName then | |||
container:wikitext(' [[' .. args._pageName .. ']]') | |||
if args. | |||
end | end | ||
if args.author then | if args.author then | ||
local link = args.authorlink == nil and args.author or args.author .. '|' .. args.authorlink | |||
container:wikitext(' by [[' ..link .. ']]') | |||
end | end | ||
Revision as of 20:48, 4 May 2023
Documentation for this module may be created at Module:NewsItem/doc
local getArgs = require('Module:Arguments').getArgs
local Flags = require('Module:Flags')
local NewsItem = {}
function NewsItem.main(frame)
local args = getArgs(frame)
local container = mw.html.create('span'):addClass('newsItem')
if args.date then
local date = mw.html.create('span'):addClass('news-date'):wikitext(mw.text.split(args.date, ' ')[1])
container:node(date)
end
if args._pageName then
container:wikitext(' [[' .. args._pageName .. ']]')
end
if args.author then
local link = args.authorlink == nil and args.author or args.author .. '|' .. args.authorlink
container:wikitext(' by [[' ..link .. ']]')
end
return container
end
return NewsItem