Module:ItemData/nav: Difference between revisions

Active Items table: plain wikilinks for inline attributes, var(--color-base) for off-white styling, em dash for missing stats, add Duration and Cast Range columns (with help from vergir-bot LLM)
Active Items table: use var(--color-subtle) for diminished notes (with help from vergir-bot LLM)
Line 237: Line 237:
local RANGE_PROPERTIES = { "AbilityCastRange", "Radius", "EndRadius" }
local RANGE_PROPERTIES = { "AbilityCastRange", "Radius", "EndRadius" }


-- Strips the icon markup from inline attributes, leaving plain wikilinks
-- Rewrites the description markup [[Module:Lang]] produces
local function restyle_inline_attributes(text)
local function restyle_description(text)
     text = text:gsub(INLINE_ATTRIBUTE_PATTERN, '[[%1|%2]]')
     text = text:gsub(INLINE_ATTRIBUTE_PATTERN, '[[%1|%2]]')
     -- Attributes with an icon but no link keep their span; follow the site text color
     -- Attributes with an icon but no link keep their span; follow the site text color
     return (text:gsub('color:#ffefd7;', 'color:var(--color-base);'))
     text = text:gsub('color:#ffefd7;', 'color:var(--color-base);')
    -- Diminished notes ("Cannot be used while Stunned...")
    return (text:gsub('color:#C0C0C0', 'color:var(--color-subtle)'))
end
end


Line 349: Line 351:
      
      
     table.insert(rows, "\n|}")
     table.insert(rows, "\n|}")
     return restyle_inline_attributes(frame:preprocess(table.concat(rows, "\n")))
     return restyle_description(frame:preprocess(table.concat(rows, "\n")))
end
end


return p
return p