「Module:WikitextLC」:修訂間差異

出自Gea-Suan Lin's Wiki
跳至導覽 跳至搜尋
本頁面具有訪問限制。如果您看見此訊息,這代表您沒有訪問本頁面的權限。
(创建页面,内容为“local p = {} function p.selective( content ) local text = '-{' for variant, value in pairs( content ) do if value == '' then value = '<s…”)
(無差異)

於 2018年2月9日 (五) 09:06 的修訂

此模塊的文檔可以在Module:WikitextLC/doc創建

local p = {}

function p.selective( content )
    local text = '-{'
    for variant, value in pairs( content ) do
        if value == '' then
            value = '<span></span>'
        end
        text = text .. variant .. ':' .. value .. ';'
    end
    text = text .. '}-'
    return text
end

function p.converted( content, variant, force )
    if type( variant ) == 'table' then
        variant = table.concat( variant, ';' )
    end
    return '-{' .. ( force and '' or 'zh;' ) .. variant .. '|' .. content .. '}-'
end

function p.raw( content )
    return '-{R|' .. content .. '}-'
end

function p.title( content )
    return '-{T|' .. content .. '}-'
end

function p.hidden( content )
    return '-{H|' .. content .. '}-'
end

return p