Module:TSLoader

Revision as of 13:22, 15 January 2026 by Ivan (talk | contribs) (Created page with "--- --- This module allows loading TemplateStyles styles only once per page. --- Although TemplateStyles has its own deduplication mechanism, it still leaves extra HTML tags after repeated loading attempts. --- By using this module, you can avoid the appearance of extra tags. --- --- Source: https://minecraft.wiki/w/Template:TSLoader --- local p = {} -- Performs loading function p.call( name ) if not name then return nil end return mw.getCurrentFrame():extensionT...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation

This module allows loading TemplateStyles styles only once per page.


Although TemplateStyles has its own deduplication mechanism.

  • It still leaves extra HTML tags after repeated loading attempts.


By using this module, you can avoid the appearance of extra tags.

Source

https://minecraft.wiki/w/Module:TSLoader


---
--- This module allows loading TemplateStyles styles only once per page.
--- Although TemplateStyles has its own deduplication mechanism, it still leaves extra HTML tags after repeated loading attempts. 
--- By using this module, you can avoid the appearance of extra tags.
---
--- Source: https://minecraft.wiki/w/Template:TSLoader
---

local p = {}

-- Performs loading
function p.call( name )
	if not name then
		return nil
	end
	return mw.getCurrentFrame():extensionTag{ name = "templatestyles", args = { src = name } }
end

-- Wrapper for use outside modules
function p.main( f )
	local args = f
	local frame = mw.getCurrentFrame()
	if f == frame then
		args = require( 'Module:ProcessArgs' ).merge( true )
	end
	return p.call( args[ 1 ] )
end

return p