Module:TemplateHelpers: Difference between revisions

// via Wikitext Extension for VSCode
// via Wikitext Extension for VSCode
Line 131: Line 131:
local wikiLinkCache = {}
local wikiLinkCache = {}


-- Process wiki links with different modes: extract, strip, or check
-- @deprecated See LinkParser.processWikiLink
-- @deprecated Direct implementation moved to LinkParser.lua
function p.processWikiLink(value, mode)
function p.processWikiLink(value, mode)
     return require('Module:LinkParser').processWikiLink(value, mode)
     return require('Module:LinkParser').processWikiLink(value, mode)
end
end


-- Extract page name from wiki link [[Name]] or [[Name|Text]]
-- @deprecated See LinkParser.extractFromWikiLink
-- @deprecated Direct implementation moved to LinkParser.lua
function p.extractFromWikiLink(value)
function p.extractFromWikiLink(value)
     return require('Module:LinkParser').extractFromWikiLink(value)
     return require('Module:LinkParser').extractFromWikiLink(value)
Line 397: Line 395:
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------


-- Generates a standard title block with configurable class and text
-- @deprecated See TemplateStructure.renderTitleBlock and AchievementSystem.renderTitleBlockWithAchievement
-- Enhanced to support achievement integration with options
-- @deprecated Direct implementation moved to TemplateStructure.lua and AchievementSystem.lua
function p.renderTitleBlock(args, titleClass, titleText, options)
function p.renderTitleBlock(args, titleClass, titleText, options)
     options = options or {}
     options = options or {}
Line 417: Line 413:
end
end


-- Helper function for wiki link handling
-- @deprecated See LinkParser.applyWikiLinkHandling
-- Adds wiki links to a value if needed based on field configuration
-- @param value The value to process
-- @param field The field configuration
-- @return The processed value with wiki links added if needed
-- @deprecated Direct implementation moved to LinkParser.lua
function p.applyWikiLinkHandling(value, field)
function p.applyWikiLinkHandling(value, field)
     return require('Module:LinkParser').applyWikiLinkHandling(value, field)
     return require('Module:LinkParser').applyWikiLinkHandling(value, field)
end
end


-- Helper function to preserve wiki links in processed values
-- @deprecated See LinkParser.preserveWikiLinks
-- If the original value had wiki links but the processed value doesn't,
-- returns the original value to preserve the wiki links
-- @param originalValue The original value before processing
-- @param processedValue The value after processing
-- @param preserveWikiLinks Whether to preserve wiki links
-- @return The value with wiki links preserved if needed
-- @deprecated Direct implementation moved to LinkParser.lua
function p.preserveWikiLinks(originalValue, processedValue, preserveWikiLinks)
function p.preserveWikiLinks(originalValue, processedValue, preserveWikiLinks)
     return require('Module:LinkParser').preserveWikiLinks(originalValue, processedValue, preserveWikiLinks)
     return require('Module:LinkParser').preserveWikiLinks(originalValue, processedValue, preserveWikiLinks)
end
end


-- Get property description from a property page
-- @deprecated See SemanticCategoryHelpers.getPropertyDescription
-- @param propertyName string The name of the property (e.g., "Has interview format")
-- @return string|nil The property description or nil if not found
-- @deprecated Direct implementation moved to SemanticCategoryHelpers.lua
function p.getPropertyDescription(propertyName)
function p.getPropertyDescription(propertyName)
     return require('Module:SemanticCategoryHelpers').getPropertyDescription(propertyName)
     return require('Module:SemanticCategoryHelpers').getPropertyDescription(propertyName)