Module:Minitree
跳到导航
跳到搜索
- local p = {}
- local getArgs = require('module:arguments').getArgs
- local alpha = {['7']=1, F=1, L=1, J=1, v=1, V=1, y=1, A=1, h=1, D=1, C=1, [')']=1, [']']=1, ['}']=1, ['+']=1, ['%']=1,
- ['!']=1, [':']=1, ['-']=1, ['~']=1, ['.']=1, [',']=1, ['`']=1, ["'"]=1, ['^']=1, ['(']=1, ['[']=1, ['*']=1, ['#']=1,
- t=1
- }
- function p.main(frame)
- local args = getArgs(frame, {parentFirst = true, removeBlanks = false})
- local text = '|-'
- for k, v in ipairs(args) do
- text = text..'\n|'
- if alpha[v] then
- text = text..'class="tree-'..v..'"|'
- elseif v == '{' then
- text = text..'class="tree-\\'..v..'"|'
- elseif v == '' then
- text = text..'|'
- else
- text = text..'colspan=3|'..(args[v] or '<span style="color:red;font-size:xx-small">模板参数疑似有误,请检查</span>')
- end
- end
- return text..'\n|'
- end
- return p