模組:CGroupViewer
外观
local z = {}
local error = require( 'Module:Error' )
function z.main( frame )
local name = frame.args[1]
if not name or name == '' then
return ''
end
local data = require( 'Module:CGroup/' .. name )
local pieces = { '以下是[[Wikipedia:字詞轉換處理/公共轉換組|公共转换组]]“' .. data.description .. '”。' }
for i, v in ipairs( data.content ) do
if v.type == 'text' then
table.insert( pieces, v.text )
elseif v.type == 'item' then
local text = ''
if v.original then
text = text .. '原文:' .. v.original
end
text = text .. '-{D|' .. v.rule .. '}-' .. '\n'
table.insert( pieces, text )
end
end
table.insert( pieces, '[[Category:公共轉換組模板|' .. name .. ']]' )
return table.concat( pieces )
end
return z