蚊子的天敌是什么| 舌头裂缝是什么原因| 敌是什么生肖| 兔女郎是什么| 皋读什么| 无痛肠镜和普通肠镜有什么区别| 潜叶蝇打什么药效果好| 梦见血是什么预兆| 吃海鲜不能吃什么水果| 进击的巨人真相是什么| 乳糖不耐受是什么症状| 小孩c反应蛋白高说明什么| 胎儿顶臀长是什么意思| 上火流鼻血吃什么降火| 手腕痛什么原因| 热水器什么品牌好| pr间期延长是什么意思| 肛裂是什么| 小巫见大巫是什么意思| 嗳腐吞酸是什么意思| 青稞面是什么| 被蚂蚁咬了怎么止痒消肿要擦什么药| 贴黄瓜片对皮肤有什么好处| 04年出生属什么| 原发性和继发性是什么意思| 太原为什么叫龙城| 支气管炎能吃什么水果| 棠字五行属什么| 黄精吃了有什么好处| 端午节都吃什么菜好| 锹形虫吃什么| 豆柏是什么| 睡觉被口水呛醒是什么原因| wl是什么意思| 来例假能吃什么水果| 茯茶属于什么茶| 南昌有什么好玩的| 脑梗用什么药效果好| 空腹吃柿子有什么危害| 女人吃什么补气血效果最好| 女人缺少雌激素吃什么| 喜用神是什么| 喜鹊进家有什么预兆| 在减肥期间吃什么最好| 埋线是什么| 2月什么星座| 天高云淡是什么季节| 肚脐左侧按压疼是什么原因| 甲状腺应该多吃什么| 吃生南瓜子有什么好处| 三月29号是什么星座| 龟头炎用什么药膏| 贫血严重会得什么病| 红痣用什么药膏去除| 11月14号什么星座| 厚黑学是什么意思| 尿液里白细胞高是什么原因| 护士节送什么鲜花| 夫妻肺片是什么| 梦到和别人吵架是什么意思| 带状疱疹用什么药| 什么是智商| 胃胀吃点什么药| 喝绿茶对身体有什么好处| hpv什么时候检查最好| 婴儿第一次理发有什么讲究吗| 散瞳后需要注意什么| 为什么会得焦虑症| 中国人的祖先是什么人| 7年之痒是什么意思| h2ra 是什么药物| 风平浪静是什么生肖| 珍珠奶茶的珍珠是什么做的| 手心长痣代表什么| 因势利导什么意思| 土霉素主要是治疗什么病| stories是什么意思| cos是什么牌子| 全套半套什么意思| 世界上最高的高原是什么| 男人眉毛长代表什么| 尿潜血1十是什么原因| 世界上最高的高原是什么| 懵的意思是什么| 什么是脱肛| 清秋是什么意思| 御风是什么意思| pt950是什么意思| 卵巢多囊样改变是什么意思| 急性青光眼是什么症状| 750金是什么金| 家宴是什么意思| 小孩出虚汗是什么原因| 痔疮吃什么药| 肾主骨是什么意思| 什么是变态| 知柏地黄丸有什么功效| 北京大学校长什么级别| 天网是什么意思| 十月6号是什么星座| 身体燥热是什么原因| a4腰什么意思| 手上月牙代表什么| 94年的属什么| 肠系膜多发淋巴结是什么意思| 冠脉造影是什么意思| 什么车可以闯红灯| 蚧壳虫用什么药最有效| 湿罗音是什么意思| 痉挛什么意思| 双手合十什么意思| 社会保险是什么意思| 一片狼藉是什么意思| 地藏菩萨求什么最灵| 甘油三酯吃什么药| 大便黑色是什么原因| 人生得意须尽欢是什么意思| 乙肝五项45阳性是什么意思| 吃什么能减肥| 蔻驰和古驰有什么区别| 高血糖什么原因引起| 先父遗传是什么意思| 胸痛一阵一阵的痛什么原因| 海绵体供血不足吃什么药| 哀鸿遍野是什么意思| 身份证穿什么衣服| 开团什么意思| 生物电是什么| 脸黄是什么原因造成的| 梦见杀蛇是什么意思| 吃什么水果解酒| 入赘什么意思| 才思敏捷是什么意思| 猫咪喜欢吃什么| 脂溢性脱发是什么原因引起的| 大便羊屎粒是什么原因| 小便尿色黄是什么问题| 左眉上方有痣代表什么| 外面下着雨犹如我心血在滴什么歌| 里字五行属什么| 丁未年五行属什么| 湿疹是长什么样的| 玄米是什么米| 传单是什么病| 夏至为什么吃馄饨| 孕妇可以喝什么饮料| 财代表什么生肖| 白带褐色什么原因| basic是什么意思| 唐人是什么意思| 陕西为什么叫三秦大地| 农业户口和居民户口有什么区别| 脂肪瘤吃什么药可以消除| 梦见老宅是什么意思| 窦性心律t波改变是什么意思| 神经元特异性烯醇化酶偏高是什么意思| 失眠是什么症状| 脚趾痒是什么原因| 验孕棒一条杠什么意思| 高抬贵手是什么意思| 宫闱是什么意思| 7点至9点是什么时辰| 抗原和抗体有什么区别| 仙灵脾又叫什么| 梦见自己大便是什么意思| 两个o型血能生出什么血型的孩子| 蓉字五行属什么| 肝病看什么科室| 山楂炖肉起什么作用| 脑梗病人吃什么营养恢复最好| 羊水偏多对胎儿有什么影响| 大脑供血不足是什么原因引起的| 脱发是什么原因引起的| 尿道感染挂什么科| 枪代表什么生肖| 胆固醇高是什么引起的| 拉血是什么原因| 肝早期硬化身体有什么症状| 怀孕血压高对胎儿有什么影响| wbc是什么意思| 尿是绿色的是什么原因| 射频是什么| 部队政委是什么级别| 肛门疼痛是什么原因引起的| 正比是什么意思| 什么地跑步| 社保卡是什么意思| 九七年属什么生肖| 竹荪是什么| 白血病有什么征兆| 血糖高吃什么水果最好| 舌裂纹吃什么可以恢复| 咳嗽吐白痰是什么病| 橄榄是什么| 楞严神咒是什么意思| 叒字什么意思| 狗狗耳螨用什么药| tim是什么| 孕妇梦见老公出轨是什么意思| 玄胡又叫什么| 空腹血糖偏高是什么原因| 血压高不能吃什么食物| 狗脚朕什么意思| 脉搏跳得快是什么原因| 净身是什么| 沪深300是什么意思| 吃饭咬舌头是什么原因| 狗翻肠子什么症状| 世界上什么东西最大| 情愫什么意思| 尿维生素c弱阳性是什么意思| 砸是什么意思| 三角区长痘痘是什么原因| 群聊名字什么最好听| 迁就什么意思| 喝什么解辣| 外科主要看什么病| 搞笑是什么意思| 桑寄生有什么功效| 滴虫性阴道炎是什么原因引起的| 什么样的人容易得结石| 玄女是什么意思| 什么是消毒| 一库一库雅蠛蝶是什么意思| 细小是什么病什么症状| 堆肥是什么意思| 卵巢囊肿是什么原因引起的| 舌苔白吃什么药效果好| 壁虎是什么类动物| 肩胛骨麻麻的什么原因| 姑姑的老公叫什么| 子宫肌瘤是什么病严重吗| 背弃是什么意思| 7.8什么星座| 轻度脑萎缩是什么意思| 属羊的和什么属相不合| 卑职是什么意思| 胃溃疡适合吃什么水果| 现在是什么星座| 肝早期硬化身体有什么症状| 音什么笑什么成语| 大姨妈期间适合吃什么水果| 塑料袋属于什么垃圾| 一加一为什么等于二| 小五行属性是什么| 有什么四字词语| 梦见自己怀孕生孩子是什么意思| 想念是什么意思| 双下肢水肿是什么原因| 为什么会得风湿| 利多卡因是什么药| 做梦飞起来了是什么兆头| 酒后吐吃什么可以缓解| 妊娠囊是什么| 胶质瘤是什么病| 脚汗多是什么原因| 什么的走| 老师的老公叫什么| 出家当和尚有什么要求| 你真狗是什么意思| 馊主意是什么意思| 太阳一晒脸就红是什么原因| 长痱子是什么原因| 小分子肽能治什么病| 百度Jump to content

衣原体阳性是什么意思

From Wikimedia Commons, the free media repository
Lua
百度 经过一年时间,逐项调查核实和驳斥了原来扣在刘少奇头上的叛徒内奸工贼等罪名,向中央作出了实事求是的复查报告。

CodeDiscussionEditHistoryLinksLink count Subpages:DocumentationTestsResultsSandboxLive code All modules

Logic for powering Template:TemplateBox.

Module Quality

Code

require('strict')

--[[
    @exports
        usagesample( frame )
        argcount( frame )
        args2table( args, onGetKey, forCustom )
        paramtable( frame )
        description( frame )
        templatedata( frame )
]]

local p = {}

-- Helper function, not exposed
local function tobool(st)
    if type( st ) == 'string' then
        return st == 'true'
    else
        return not not st
    end
end


-- Required to determine in which languages the interface texts without langcode are
local contentLangcode = mw.language.getContentLanguage():getCode()
-- Forward declaration
local msg, langIsInit, userLang
local messagePrefix = "templatedata-doc-"
local i18n = {}
i18n['params'] = "Template parameters"
i18n['param-name'] = "Parameter"
i18n['param-desc'] = "Description"
i18n['param-type'] = "Type"
i18n['param-default'] = "Default"
i18n['param-status'] = "Status"
i18n['param-status-optional'] = "optional"
i18n['param-status-required'] = "required"
i18n['param-status-suggested'] = "suggested"
i18n['param-status-deprecated'] = "deprecated"
i18n['param-default-empty'] = "empty"

local function initLangModule(frame)
    if langIsInit then
        return
    end

    userLang = frame:preprocess( '{{int:lang}}' )

    --! From [[:de:Modul:Expr]]; by [[:de:User:PerfektesChaos]]; 
    --! Derivative work: Rillke
    msg = function( key )
        -- Retrieve localized message string in content language
        -- Precondition:
        --     key  -- string; message ID
        -- Postcondition:
        --     Return some message string
        -- Uses:
        --     >  messagePrefix
        --     >  i18n
        --     >  userLang
        --     mw.message.new()
        local m = mw.message.new( messagePrefix .. key )
        local r = false
        if m:isBlank() then
            r = i18n[ key ]
        else
            m:inLanguage( userLang )
            r = m:plain()
        end
        if not r then
            r = '((('.. key .. ')))'
        end
        return r
    end -- msg()
    
    langIsInit = true
end

-- A "hash" / table of everything TemplateData takes
-- to ease maintenance.

-- The type is automatically determined if t is omitted.
-- If the type does not match or can't be converted, an error will be thrown!
-- Available types (LUA-Types with exceptions): 
--      InterfaceText, boolean, number, selection, table, string
-- selection*: - requires a selection-string of pipe-separated possibilities to be supplied
-- InterfaceText*: A free-form string (no wikitext) in the content-language of the wiki, or, 
-- an object containing those strings keyed by language code.
local paraminfoTemplate = {
    description = {
        default = '',
        t = 'InterfaceText',
        alias = 'desc'
    },
    format = {
		default = 'inline',
		t = 'selection',
		selection = 'inline|block',
		alias = 'print',
		extract = function(pargs, number, paramVal)
			local m = { multi = 'block', one = 'inline', infobox = 'block' }
            return m[paramVal] or 'inline'
        end
	}
}
local paraminfoTLParams = {
    label = {
        default = '',
        t = 'InterfaceText'
    },
    required = {
        default = false,
        extract = function(pargs, number, paramVal)
            local req = (pargs[number .. 'stat'] == 'required')
            return tobool( paramVal or req )
        end
    },
    suggested = {
        default = false,
        extract = function(pargs, number, paramVal)
            local sugg = (pargs[number .. 'stat'] == 'suggested')
            return tobool( paramVal or sugg )
        end
    },
    description = {
        default = '',
        t = 'InterfaceText',
        alias = 'd'
    },
    deprecated = {
        default = false,
        extract = function(pargs, number, paramVal)
            local depr = (pargs[number .. 'stat'] == 'deprecated')
            return tobool( paramVal or depr )
        end
    },
    aliases = {
        default = '',
        t = 'table',
        extract = function(pargs, number, paramVal)
            local key = number .. 'aliases'
            local tdkey = key .. '-td'
            local aliases = pargs[tdkey] or pargs[key]
            if aliases and mw.text.trim( aliases ) ~= '' then
                local cleaned = {}
                for m in mw.text.gsplit( aliases, '/', true ) do
                    cleaned[#cleaned+1] = mw.text.trim(m)
                end
                return cleaned
            else
                return nil
            end
        end
    },
    default = {
        default = '',
        t = 'string',
        alias = 'def'
    },
    type = {
        default = 'unknown',
        t = 'selection',
        selection = 'unknown|number|string|string/wiki-user-name|string/wiki-page-name|string/line|line|wiki-page-name|wiki-file-name|wiki-user-name|wiki-template-name|content|unbalanced-wikitext|date|url|boolean'
    },
    inherits = {
        default = nil,
        t = 'string'
    },
    autovalue = {
        default = '',
        t = 'string',
        alias = 'av',
    },
    suggestedvalues = {
        default = '',
        t = 'table',
        alias = 'sv',
        extract = function(pargs, number, paramVal)
            if paramVal == nil then
                return nil
            end
            local cleaned = {}
            for m in mw.text.gsplit( paramVal, '/', true ) do
                cleaned[#cleaned+1] = mw.text.trim(m)
            end
            return cleaned
        end,
    },
    -- sets will be treated differently because we can only have a plain structure in wikitext
}
local tableLayout = {
    {
        col = 'param-name',
        width = '15%',
        extract = function(item, renderCell, monolingual)
            local alias, param = '', item.key
            local aliasTT = '<span style="font-family: monospace; color:#777; border:1px solid #6A6A6A">'

            param = '<code>' .. param .. '</code>'
            if item.aliases then
                alias = aliasTT .. table.concat(item.aliases, '</span><br />' .. aliasTT) .. '</span>'
                param = table.concat({param, '<br /><div>', alias, '</div>'})
            end
            renderCell(param)
        end
    },  {
        col = 'param-desc',
        cols = 2,
        width = '65%',
        extract = function(item, renderCell, monolingual)
            local label = item.label or ''
            label = monolingual(label)
            local labelLen = #label
            local colspan = 2 - labelLen
        
            if labelLen > 0 then
                renderCell(label)
            end
        
            renderCell(monolingual(item.description), colspan)
        end
    },  {
        col = 'param-default',
        width = '10%',
        extract = function(item, renderCell, monolingual)
            local def = monolingual(item.default) or ''
            if #def == 0 then
                def = '<span class="mw-templatedata-doc-muted" style="color:#777; font-variant:small-caps">' .. msg('param-default-empty') .. '</span>'
            end
            renderCell(def)
        end
    },  {
        col = 'param-status',
        width = '10%',
        extract = function(item, renderCell, monolingual)
            local stat = msg('param-status-optional')
            if item.required then
                stat = '<b>' .. msg('param-status-required') .. '</b>'
            elseif item.deprecated then
                stat = msg('param-status-deprecated')
            elseif item.suggested then
                stat = msg('param-status-suggested')
            end
            renderCell(stat)
        end
    }
}

-- Initialize param info
-- Avoids having to add redundant information to the preceding tables
local function init( which )
    local setDefault = function(v)
        if v.t == nil and v.default ~= nil then
            v.t = type( v.default )
        end
        if v.selection then
        	local selection = mw.text.split(v.selection, '|', true)
        	v.selection = {}
        	for _, sel in ipairs(selection) do
        		v.selection[sel] = true
        	end
        end
    end
    for a, v in pairs( which ) do
        setDefault(v)
    end
end
local function initParamTables()
    init( paraminfoTemplate )
    init( paraminfoTLParams )
end

------------------------------------------------------
-------------------- USAGE PART ----------------------
------------------------------------------------------
function p.argcount( frame )
    local pargs = ( frame:getParent() or {} ).args or {}
    local ac = 0
    for i, arg in pairs( pargs ) do
        if ('number' == type(i)) then
            ac = ac + 1
        end
    end
    return ac
end

function p.usagesample( frame )
    local pargs = ( frame:getParent() or {} ).args or {}
    local multiline = (pargs.lines == 'multi' or pargs.print == 'multi' or pargs.print == 'infobox')
    local align = pargs.print == 'infobox'
    if not pargs.lines and not pargs.print and pargs.type == 'infobox' then
        multiline = true
        align = true
    end
    local sepStart = ' |'
    local sepEnd = multiline  and '\n' or ''
    local sep = sepEnd
    local subst = #(pargs.mustbesubst or '') > 0 and 'subst:' or ''
    local beforeEqual = multiline  and ' ' or ''
    local equal = beforeEqual .. '= '
    local templateTitle = pargs.name or ''
    local args, argName, result = {}
    local maxArgLen, eachArg = 0
    sep = sep .. sepStart
    
    local sparseIpairs = require('Module:TableTools').sparseIpairs
    local comapareLegacyVal = function(val)
        return val == 'optional-' or val == 'deprecated'
    end
    local shouldShow = function(i)
        if comapareLegacyVal(pargs[i .. 'stat']) or
            comapareLegacyVal(pargs[i .. 'stat-td']) or
            pargs[i .. 'deprecated'] == true then 
                return false
            end
        return true
    end
    
    eachArg = function(cb)
        for i, arg in sparseIpairs( pargs ) do
            if ('number' == type(i)) then
                argName = mw.text.trim( arg or '' )
                if #argName == 0 then
                    argName = tostring(i)
                end
                
                if shouldShow(i) then
                    cb(argName)
                end
            end
        end
    end
    
    if align then
        eachArg(function( arg )
            local argL = #arg
            maxArgLen = argL > maxArgLen and argL or maxArgLen
        end)
    end
    
    eachArg(function( arg )
        local space = ''
        if align then
            space = ('&nbsp;'):rep(maxArgLen - #arg)
        end
        table.insert( args, argName .. space .. equal )
    end)
    
    if #args == 0 then
        sep = ''
        sepEnd = ''
        sepStart = ''
    end
    if #templateTitle == 0 then
        templateTitle = mw.title.getCurrentTitle().text
    end
    result = table.concat( args, sep )
    result = table.concat({ mw.text.nowiki('{{'), subst, templateTitle, sep, result, sepEnd, '}}' })
    if multiline then
        -- Preserve whitespace in front of new lines
        result = frame:callParserFunction{ name = '#tag', args = { 'poem', result } }
    end
    return result
end

------------------------------------------------------
------------------- GENERAL PART ---------------------
------------------------------------------------------
function p.args2table(args, onGetKey, consumer)
    initParamTables()
    
    local sets, asParamArray, laxtype, processParams, processDesc, unstrip
    if 'paramtable' == consumer then
        asParamArray = true
        processParams = true
        laxtype = true
    elseif 'templatedata' == consumer then
        sets = true
        processParams = true
        processDesc = true
        unstrip = true
    elseif 'description' == consumer then
        processDesc = true
        laxtype = true
    end
    -- All kind of strange stuff with the arguments is done, so play safe and make a copy
    local pargs = mw.clone( args )
    -- Array-like table containing all parameter-numbers that were passed
    local templateArgs = {}
    -- Arguments that are localized (i.e. the user passed  1desc-en=English description of parameter one)
    local i18nTemplateArgs = {}
    -- Ensure that tables end up as array/object (esp. when they are empty)
    local tdata = {description="", params={}, sets={}}
    local isObject = { __tostring = function() return "JSON object" end }    isObject.__index = isObject
    local isArray  = { __tostring = function() return "JSON array"  end }    isArray.__index  = isArray
    setmetatable(tdata.params, isObject)
    setmetatable(tdata.sets, isArray)
    onGetKey = onGetKey or function( prefix, alias, param )
        local key, key2, tdkey, tdkey2
        key = prefix .. (alias or param)
        key2 = prefix .. param
        tdkey = key .. '-td'
        tdkey2 = key2 .. '-td'
        return tdkey, tdkey2, key, key2
    end
    
    local extractData = function( pi, number )
        local prefix = number or ''
        local ppv, paramVal
        local key1, key2, key3, key4
        local paramKey, paramTable, processKey
        if number then
            paramKey = mw.text.trim( pargs[number] )
            if '' == paramKey then
                paramKey = tostring( number )
            end
            
            paramTable = {}
            if asParamArray then
                paramTable.key = paramKey
                table.insert(tdata.params, paramTable)
            else
                tdata.params[paramKey] = paramTable
            end
        end
        for p, info in pairs( pi ) do
            key1, key2, key3, key4 = onGetKey(prefix, info.alias, p)
            paramVal = nil
            
            processKey = function(key)
                if paramVal ~= nil then return end
                local plain, multilingual = pargs[key], i18nTemplateArgs[key]
                paramVal = multilingual or plain
            end
            processKey( key1 )
            processKey( key2 )
            processKey( key3 )
            processKey( key4 )
            
            -- Ensure presence of entry in content language
            ppv = pargs[key1] or pargs[key2] or pargs[key3] or pargs[key4] or info.default
            if 'table' == type( paramVal ) then
                if (nil == paramVal[contentLangcode]) then
                    paramVal[contentLangcode] = ppv
                end
            else
                paramVal = ppv
            end

            if 'function' == type( info.extract ) then
                if 'string' == type( paramVal ) then
                    paramVal = mw.text.trim( paramVal )
                    if '' == paramVal then
                        paramVal = nil
                    end
                end
                paramVal = info.extract( pargs, number, paramVal )
            end
            
            local insertValue = function()
                if number then
                    paramTable[p] = paramVal
                else
                    tdata[p] = paramVal
                end
            end
            
            if info.selection then
                if info.selection[paramVal] then
                    insertValue()
                end
            elseif 'InterfaceText' == info.t then
                if ({ table=1, string=1 })[type( paramVal )] then
                    insertValue()
                end
            else
                local paramType = type( paramVal )
                if 'string' == info.t and 'string' == paramType then
                    paramVal = mw.text.trim( paramVal )
                    if '' ~= paramVal then
                        insertValue()
                    end
                elseif 'boolean' == info.t then
                    paramVal = tobool(paramVal)
                    insertValue()
                elseif 'number' == info.t then
                    paramVal = tonumber(paramVal)
                    insertValue()
                elseif paramType == info.t then
                    insertValue()
                elseif paramType == 'nil' then
                    -- Do nothing
                elseif not laxtype and 'string' == info.t and 'table' == paramType then
                    -- Convert multilingual object into content language string
                    paramVal = paramVal[contentLangcode]
                    insertValue()
                else
                    if laxtype then
                        insertValue()
                    else
                        error( p .. ': Is of type ' ..  paramType .. ' but should be of type ' .. (info.t or 'unknown'), 1 )
                    end
                end
            end
        end
        -- Now, treat sets
        if sets then
            key1 = prefix .. 'set-td'
            key2 = prefix .. 'set'
            paramVal = pargs[key1] or pargs[key2]
            if paramVal then
                local found = false
                for i, s in ipairs( tdata.sets ) do
                    if s.label == paramVal then
                        table.insert( s.params, p )
                        found = true
                    end
                end
                if not found then
                    table.insert( tdata.sets, {
                        label = paramVal, 
                        params = { p }
                    } )
                end
            end
        end
    end
    
    -- First, analyse the structure of the provided arguments
    for a, v in pairs( pargs ) do
        if unstrip then
            v = mw.text.unstrip( v )
            pargs[a] = v
        end
        if type( a ) == 'number' then
            table.insert( templateArgs, a )
        else
            local argSplit = mw.text.split( a, '-', true )
            local argUnitl = {}
            local argAfter = {}
            local isTDArg = false
            local containsTD = a:find( '-td', 1, true )
            for i, part in ipairs( argSplit ) do
                if isTDArg or (containsTD == nil and i > 1) then
                    -- This is likely a language version
                    table.insert( argAfter, part )
                else
                    table.insert( argUnitl, part )
                end
                if part == 'td' then
                    isTDArg = true
                end
            end
            if #argAfter > 0 then
                argUnitl = table.concat( argUnitl, '-' )
                argAfter = table.concat( argAfter, '-' )
                i18nTemplateArgs[argUnitl] = i18nTemplateArgs[argUnitl] or {}
                i18nTemplateArgs[argUnitl][argAfter] = v
            end
        end
    end
    -- Then, start building the actual template
    if processDesc then
        extractData( paraminfoTemplate )
    end
    if processParams then
        -- Ensure that `templateArgs` contains indicies in ascending order
        table.sort( templateArgs )
        for i, number in pairs( templateArgs ) do
            extractData( paraminfoTLParams, number )
        end
    end
    return tdata, #templateArgs
end



------------------------------------------------------
------------ CUSTOM PARAMETER TABLE PART -------------
------------------------------------------------------

-- A custom key-pref-function
local customOnGetKey = function( prefix, alias, param )
    local key, key2, tdkey, tdkey2
    key = prefix .. (alias or param)
    key2 = prefix .. param
    tdkey = key .. '-td'
    tdkey2 = key2 .. '-td'
    return key2, key, tdkey2, tdkey
end
local toUserLanguage = function(input)
    if type(input) == 'table' then
        input = require( 'Module:LangSwitch' )._langSwitch( input, userLang ) or ''
    end
    return input
end

function p.description(frame)
    local pargs = ( frame:getParent() or {} ).args or {}

    -- Initialize the language-related stuff
    initLangModule(frame)

    local tdata, paramLen
    tdata, paramLen = p.args2table(pargs, customOnGetKey, 'description')
    return toUserLanguage(tdata.description)
end


function p.paramtable(frame)
    local pargs = ( frame:getParent() or {} ).args or {}
    local tdata, paramLen
    
    if 'only' == pargs.useTemplateData then
        return 'param table - output suppressed'
    end
    
    -- Initialize the language-related stuff
    initLangModule(frame)

    tdata, paramLen = p.args2table(pargs, customOnGetKey, 'paramtable')
    
    
    if 0 == paramLen then
        return ''
    end
    
    local row, rows = '', {}
    local renderCell = function(wikitext, colspan)
        local colspan, oTd = colspan or 1, '<td>'
        if colspan > 1 then
            oTd = '<td colspan="' .. colspan .. '">'
        end
        row = table.concat({ row, oTd, wikitext, '</td>' })
    end
    
    -- Create the header
    for i, field in ipairs( tableLayout ) do
        local style = ' style="width:' .. field.width .. '"'
        local colspan = ''
        if field.cols then
            colspan = ' colspan="' .. field.cols .. '"'
        end
        local th = '<th' .. style .. colspan .. '>'

        row = row .. th .. msg(field.col) .. '</th>'
    end
    table.insert(rows, row)
    
    -- Now transform the Lua-table into an HTML-table
    for i, item in ipairs( tdata.params ) do
        row = ''
        for i2, field in ipairs( tableLayout ) do
            field.extract(item, renderCell, toUserLanguage)
        end
        table.insert(rows, row)
    end
    return '<table class="wikitable templatebox-table"><tr>' .. table.concat(rows, '</tr><tr>') .. '</tr></table>'
end


------------------------------------------------------
----------------- TEMPLATEDATA PART ------------------
------------------------------------------------------

-- A real parser/transformer would look differently but it would likely be much more complex
-- The TemplateData-portion for [[Template:TemplateBox]]
function p.templatedata(frame)
    local tdata
    local args = frame.args or {}
    local formatting = args.formatting
    local pargs = ( frame:getParent() or {} ).args or {}
    local useTemplateData = pargs.useTemplateData

    if  (formatting == 'pretty' and useTemplateData ~= 'export') or
        (not useTemplateData) or
        (useTemplateData == 'export' and formatting ~= 'pretty') then
            local warning = "Warning: Module:TemplateBox - templatedata invoked but not requested by user (setting useTemplateData=1)."
            mw.log(warning)
            tdata = '{"description":"' .. warning .. '","params":{},"sets":[]}'
            return tdata
    end
    
    -- Load the JSON-Module which will convert LUA tables into valid JSON
    local JSON = require('Module:JSON')
    JSON.strictTypes = true
    -- Obtain the object containing info
    tdata = p.args2table(pargs, nil, 'templatedata')
    -- And finally return the result
    if formatting == 'pretty' then
        return JSON:encode_pretty(tdata)
    else
        return JSON:encode(tdata)
    end
end

return p
绾色是什么颜色 白羊女和什么星座最配 为什么脖子上会长痘痘 卵巢囊肿术后吃什么食物好 肾错构瘤是什么病
12月22日什么星座 什么是催眠 一直耳鸣是什么原因引起的 发烧不能吃什么水果 古代女子成年行什么礼
大腿出汗是什么原因 汉字最多笔画是什么字 手指甲没有月牙是什么原因 ltp是什么意思 俄罗斯信奉什么教
孝顺的真正含义是什么 b和o型血生的孩子是什么血型 暴发火眼吃什么药 黄金芽是什么茶 幽门螺旋杆菌感染是什么意思
梦见春梦是什么意思hcv8jop6ns7r.cn sweet什么意思hcv8jop0ns6r.cn 女人阴虚火旺吃什么药hanqikai.com 肾炎吃什么食物好hcv8jop2ns9r.cn 感冒了吃什么水果hcv8jop7ns6r.cn
小儿消化不良吃什么药最好hcv8jop0ns9r.cn 肝异常一般是什么情况cj623037.com 虫至念什么hcv9jop6ns7r.cn 高血脂是什么意思hcv8jop9ns1r.cn 什么药能降肌酐hcv9jop0ns6r.cn
什么是盆腔积液hcv8jop9ns7r.cn 你太low了是什么意思hcv8jop4ns5r.cn 身份证最后一位代表什么creativexi.com 左侧卵巢内囊性回声是什么意思hcv7jop6ns1r.cn 中午十二点是什么时辰hcv9jop8ns2r.cn
speedo是什么牌子huizhijixie.com 蜂蜜变质是什么样子hcv7jop5ns3r.cn 属兔的守护神是什么菩萨hcv9jop4ns6r.cn 经常头晕是什么原因xianpinbao.com 70岁是什么之年hcv8jop4ns1r.cn
百度