-Happy New Year 2025!
View source for Module:Parser
Jump to navigation
Jump to search
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page.
local p = {}
local cargo = mw.ext.cargo
-- Color frame advantage text based on value (positive or negative)
function p.colorizeFrameAdvantage(frame)
-- Set the string to the first argument given
local str = frame.args[1]
-- Surrond all plus values with a span with style color green
str = string.gsub(str, "(%+%d+)", "<span style=\"color:green;\">%1</span>")
-- Surrond all negative values with a span with style color green
str = string.gsub(str, "(%-%d+)", "<span style=\"color:red;\">%1</span>")
-- Return the string
return str
end
-- Create a wikitext hyperlink that links to the frame data page section of a move
-- Assumes the section header is the same as moveInput
function p.createFrameDataLink(frame)
-- Target cargo table to query
local cargoTable = frame.args['cargoTable']
000
1:0
Template used on this page:
Return to Module:Parser.