Module:TSLoader: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 7: | Line 7: | ||
--- By using this module, you can avoid the appearance of extra tags. | --- By using this module, you can avoid the appearance of extra tags. | ||
--- | --- | ||
--- Source: https://minecraft.wiki/w/ | --- Source: https://minecraft.wiki/w/Module:TSLoader | ||
--- | --- | ||
Revision as of 15:10, 15 January 2026
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