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/Module: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