模組:Indicator
外观
--模块控制indicator功能
local getArgs = require('Module:Arguments').getArgs
local p = {}
function p.main(frame)
local args = getArgs(frame)
local text
if args.image then
text = '[[File:' .. args.image .. '|' .. (args.size or '24px') .. '|' .. args.alt .. '|link=' .. args.link .. ']]'
end
if args.text then
text = text .. args.text
end
if args.title then
text = tostring( mw.html.create( 'div' ):attr( 'title', args.title ):wikitext( text ) )
end
if text and text ~= '' then
return frame:extensionTag{
name = 'indicator',
content = text,
args = { name = string.format( '%x', require( 'Module:Crc32lua' ).crc32( text ) ) },
}
else
return
end
end
return p