Anonymous

Module:Data Table/Tags: Difference between revisions

From Zelda Wiki, the Zelda encyclopedia
no edit summary
No edit summary
No edit summary
Line 34: Line 34:
local function value(templateName, hasGameParam)
local function value(templateName, hasGameParam)
return {
return {
stylesheets = {"Module:Value/Styles.css"},
formatter = function(cell, tableArgs, tagArgs)
formatter = function(cell, tableArgs, tagArgs)
local values = utilsString.split(cell, '%s*,[%D+|%s*]')
local values = utilsString.split(cell, '%s*,[%D+|%s*]')
Line 150: Line 149:
-- - sortValue (optional): a column sort value — column is unsortable if false, sorted by its content if nil
-- - sortValue (optional): a column sort value — column is unsortable if false, sorted by its content if nil


-- stylesheets (optional): a list of all TemplateStyles stylesheets that would be transcluded as a result of calling fn
-- noCopy (optional): if set to true, the tag will not be automatically carried over to copies of the table  
-- noCopy (optional): if set to true, the tag will not be automatically carried over to copies of the table  
contentTags = {
contentTags = {
Line 181: Line 179:
},
},
["NotApplicable"] = {
["NotApplicable"] = {
stylesheets = {"Template:NA/Styles"},
formatter = function(cell) -- special case: cell starts with N/A
formatter = function(cell) -- special case: cell starts with N/A
local text, info = utilsMarkup.separateMarkup(cell)
local text, info = utilsMarkup.separateMarkup(cell)
Line 194: Line 191:


["Amounts"] = {
["Amounts"] = {
stylesheets = {"Template:Icon List/Styles.css"},
formatter = function(cell, tableArgs, tagArgs)
formatter = function(cell, tableArgs, tagArgs)
local text = frame:expandTemplate({
local text = frame:expandTemplate({
Line 243: Line 239:
},
},
["IconList"] = {
["IconList"] = {
stylesheets = {"Template:Icon List/Styles.css"},
formatter = function(cell, tableArgs, tagArgs)
formatter = function(cell, tableArgs, tagArgs)
local cellSize = 0
local cellSize = 0
Line 322: Line 317:
["TermList"] = terms("TermList"),
["TermList"] = terms("TermList"),
["Transcript"] = {
["Transcript"] = {
stylesheets = {"Template:Transcript/Styles.css"},
formatter = function(cell, tableArgs, tagArgs)
formatter = function(cell, tableArgs, tagArgs)
local text = string.gsub(cell, "%[Player Name%]", playerName())
local text = string.gsub(cell, "%[Player Name%]", playerName())