Module:Navbox:修订间差异
删除的内容 添加的内容
创建 Navbox(融合 enwiki/zhwiki/mworg 版本) |
EvenoddContext: 跨层奇偶交替,子导航框奇偶行从父级接续 |
||
第37行:
end
local function getSubgroup(args, listnum, listText, prefix, evenodd_start)
local subArgs = {
[cfg.arg.border] = cfg.keyword.border_subgroup,
第56行:
end
end
return hasSubArgs and p._navbox(subArgs, evenodd_start) or listText
end
-- Main functions
function p._navbox(args, evenodd_start)
if args.type == cfg.keyword.with_collapsible_groups then
return p._withCollapsibleGroups(args)
第89行:
changer = first
else
local index = (type(evenodd_start) == 'number') and evenodd_start or 0
changer = function (code)
if code == '0' then
第300行:
local list_and_num = andnum('list', listnum)
local listText =
local isSubgroup = inArray(cfg.keyword.subgroups, listText)
if isSubgroup then
-- [EvenoddContext] 当前行 index(1-based)的 parity:
-- index=1→odd=0, index=2→even=1, index=3→odd=0 ...
-- 子级应从下一个 parity 开始,以实现跨层连续交替
local next_start = index % 2
listText = getSubgroup(args, listnum, listText, nil, next_start)
end▼
local oddEven = cfg.marker.oddeven
▲ end
local liststyle_and_num = andnum('liststyle', listnum)
| |||