「モジュール:Infobox/former」の版間の差分
ナビゲーションに移動
検索に移動
細
編集の要約なし
template>Waiesu 細編集の要約なし |
template>Waiesu 細編集の要約なし |
||
9行目: | 9行目: | ||
local args = require('Module:Arguments').getArgs(frame, {parentOnly = true}) | local args = require('Module:Arguments').getArgs(frame, {parentOnly = true}) | ||
local child = (args.child == 'yes') | local child = (args.child == 'yes') | ||
local h = {subheader = { | local h = {subheader = {}, image = {{}}} | ||
local body = {} | local body = {} | ||
local link = args.tnavbar or args.name | local link = args.tnavbar or args.name | ||
15行目: | 15行目: | ||
local function args2tbl(str, k, v) | local function args2tbl(str, k, v) | ||
local num = string.match(k, '%d*$') | |||
h[str][1] = | num = (num == '') and 1 or tonumber(num) | ||
h[str][num] = h[str][num] or {} | |||
if k == str then | |||
h[str][1][1] = v | |||
elseif string.match(k, str .. '%d+') then | elseif string.match(k, str .. '%d+') then | ||
h[str][num][1] = v | |||
h[str][num] = | |||
elseif string.find(k, 'style') then | elseif string.find(k, 'style') then | ||
if string.match(k, 'style$') then | if string.match(k, 'style$') then | ||
h[str]['style'] = v | h[str]['style'] = v | ||
else | else | ||
h[str][num]['style'] = v | h[str][num]['style'] = v | ||
end | end | ||
31行目: | 32行目: | ||
h[str]['rowclass'] = v | h[str]['rowclass'] = v | ||
else | else | ||
h[str][num]['rowclass'] = v | h[str][num]['rowclass'] = v | ||
end | end | ||
104行目: | 104行目: | ||
end | end | ||
for k, v in | for k, v in pairs(body) do | ||
result = result .. row(v.header, args.headerstyle, v.label, args.labelstyle, v.data, args.datastyle, v.class, v.rowclass, v.id, v.itemprop, v.rowitemprop, v.itemtype, v.rowitemtype, v.itemref, v.rowitemref) | result = result .. row(v.header, args.headerstyle, v.label, args.labelstyle, v.data, args.datastyle, v.class, v.rowclass, v.id, v.itemprop, v.rowitemprop, v.itemtype, v.rowitemtype, v.itemref, v.rowitemref) | ||
end | end |