Module:TSLoader: Difference between revisions
Jump to navigation
Jump to search
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..." |
No edit summary |
||
| Line 1: | Line 1: | ||
--- | --- | ||
--- This module allows loading TemplateStyles styles only once per page. | --- This module allows loading TemplateStyles styles only once per page. | ||
--- Although TemplateStyles has its own deduplication mechanism | --- | ||
--- 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. | --- By using this module, you can avoid the appearance of extra tags. | ||
--- | --- | ||
Revision as of 13:22, 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/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