Module:DisplayTemplate: Difference between revisions
mNo edit summary |
// via Wikitext Extension for VSCode |
||
| (6 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
-- Uses | --[[ | ||
* Name: DisplayTemplate | |||
* Author: Mark W. Datysgeld | |||
* Description: Template content display without category invocation, useful for documentation and debugging | |||
* Notes: Uses frame:expandTemplate to render template content, then strips all category links with pattern matching | |||
]] | |||
local p = {} | local p = {} | ||
| Line 10: | Line 15: | ||
local templateContent = mw.getCurrentFrame():expandTemplate{title = templateName} | local templateContent = mw.getCurrentFrame():expandTemplate{title = templateName} | ||
templateContent = templateContent:gsub("%[%[Category:[^]]+%]%]", "") | |||
return templateContent | return templateContent | ||
end | end | ||
return p | return p | ||