WikiBuilder
329
个编辑
小无编辑摘要 |
小无编辑摘要 |
||
第93行: | 第93行: | ||
local rawTxt = mw.getCurrentFrame():expandTemplate{ title = 'Stories/' .. args['fName'] }; | local rawTxt = mw.getCurrentFrame():expandTemplate{ title = 'Stories/' .. args['fName'] }; | ||
local CNameTxt = mw.getCurrentFrame():expandTemplate{ title = 'Stories/CName' }; | local CNameTxt = mw.getCurrentFrame():expandTemplate{ title = 'Stories/CName' }; | ||
local CName = {}; ---@type table | local CName = setmetatable({},{ | ||
__index = function(t,k) | |||
local _,e,_ = string.find(k,"%."); | |||
if e then return rawget(t,string.sub(k,1,e-1));end | |||
return nil; | |||
end | |||
}); ---@type table | |||
for n,t in string.gmatch(CNameTxt .. '\n','([%a%d%-]*): (.-)\n')do | for n,t in string.gmatch(CNameTxt .. '\n','([%a%d%-]*): (.-)\n')do | ||
CName[n] = t; | CName[n] = t; |