Module:GenerateDescription/Team: Difference between revisions

From TwogPedia
(Created page with "local getArgs = require('Module:Arguments').getArgs local p = {} function p.main(frame) local args = getArgs(frame) end return p")
 
mNo edit summary
 
Line 5: Line 5:
function p.main(frame)
function p.main(frame)
   local args = getArgs(frame)
   local args = getArgs(frame)
  local currentTitle = mw.title.getCurrentTitle().text
  local currentTitleSplit = mw.text.split(currentTitle, '/')
  local game = currentTitleSplit[1]


  local div = mw.html.create('div')
  local org = args.org and (' is the ' .. game .. ' team of [[Companies/' .. args.org .. ']]') or ' a ' .. game .. ' team'
  local founded = args.founded and (' that was founded on ' .. args.founded ) or ''
  local region = args.region and ('They compete in the ' .. args.region .. ' region') or ''
  local roster = args.roster and ( args.region and (' and have a ' .. args.roster .. ' roster ' ) or ('They have a ' .. args.roster .. ' roster') ) or ''
  div:wikitext(mw.ext.displaytitle.get(currentTitle) .. org  .. founded .. '. ' .. region .. roster)
  return div
end
end


return p
return p

Latest revision as of 12:43, 30 April 2024

Documentation for this module may be created at Module:GenerateDescription/Team/doc

local getArgs = require('Module:Arguments').getArgs

local p = {}

function p.main(frame)
  local args = getArgs(frame)
  local currentTitle = mw.title.getCurrentTitle().text
  local currentTitleSplit = mw.text.split(currentTitle, '/')
  local game = currentTitleSplit[1]

  local div = mw.html.create('div')
  local org = args.org and (' is the ' .. game .. ' team of [[Companies/' .. args.org .. ']]') or ' a ' .. game .. ' team'
  local founded = args.founded and (' that was founded on ' .. args.founded ) or ''
  local region = args.region and ('They compete in the ' .. args.region .. ' region') or ''
  local roster = args.roster and ( args.region and (' and have a ' .. args.roster .. ' roster ' ) or ('They have a ' .. args.roster .. ' roster') ) or ''
  div:wikitext(mw.ext.displaytitle.get(currentTitle) .. org  .. founded .. '. ' .. region .. roster)

  return div
end

return p