張正
偶然
登入
隨譔
介紹韋那威其 Vi-na-uy-ki
𠳒否認
尋檢
䀡碼源𧵑模庉:Danh sách
←
模庉:Danh sách
伴空得權𢯢𢷮張尼、爲理由𢖖󠄁:
只仍成員𥪝𡖡
成員通常
㵋得寔現操作尼。
伴吻固体䀡吧抄劄碼源𧵑張尼。
---Các hàm để xây dựng danh sách. local p = {} local viet ---Cho ra các tham số như một danh sách nội dòng. -- Hàm này hỗ trợ số tham số không hạn chế. function p.inlineList(frame) local contentFrame = frame if not frame.args[1] then contentFrame = frame:getParent() end local start = tonumber(contentFrame.args.start or frame.args.start or 1) or 1 local insep = contentFrame.args.insep local items = {} for i, arg in ipairs(contentFrame.args) do if i >= start then local item = tostring(mw.text.trim(arg)) if #item > 0 then if insep then local subitems = mw.text.split(item, insep) for i, subitem in ipairs(subitems) do table.insert(items, subitem) end else table.insert(items, item) end end end end if contentFrame.args.sorted and tonumber(contentFrame.args.sorted) == 1 then viet = viet or require "Module:Quốc ngữ" table.sort(items, viet.comp) end local format = contentFrame.args.format if format then for i, item in ipairs(items) do items[i] = mw.ustring.format(format, item) end end local space = contentFrame.args.space or frame.args.space or " " local conj = contentFrame.args.conj or frame.args.conj if #items > 1 and conj then items[#items] = conj .. space .. items[#items] end local output if #items == 2 and conj then output = items[1] .. space .. items[2] else local sep = contentFrame.args.sep or frame.args.sep or "," output = table.concat(items, sep .. space) end if #output < 1 and contentFrame.args.placeholder then output = contentFrame.args.placeholder end return output end return p
板㑄用𥪝張尼:
模庉:Danh sách/材料
(
䀡碼源
)
𢮿吏
模庉:Danh sách
。