Module:Sandbox/Star0/1:修订间差异

来自Arcaea中文维基
无编辑摘要
无编辑摘要
第1行: 第1行:
local p = {}
local p = {}
local Gjson = mw.text.jsonDecode(mw.getCurrentFrame():expandTemplate{ title = 'Songlist' } )


local loadJson = require('Module:LoadJson')
local loadJson = require('Module:LoadJson')


 
function p.maint()
function p.main()
-- if json == nil
json = Gjson
json = loadJson.Songlist()
-- end
s = #json["songs"]
s = #json["songs"]
return s
return s
end
end


function p.maint()
-- local Gjson = mw.text.jsonDecode(mw.getCurrentFrame():expandTemplate{ title = 'Songlist' } )
if json == nil
 
then json = loadJson.Songlist()
function p.main()
end
json = Gjson
s = #json["songs"]
s = #json["songs"]
return s
return s

2022年7月28日 (四) 00:21的版本

可在Module:Sandbox/Star0/1/doc创建此模块的帮助文档

local p = {}

local loadJson = require('Module:LoadJson')

function p.maint()
	-- if json == nil 
	 json = loadJson.Songlist()
	-- end
	s = #json["songs"]
	return s
end

-- local Gjson = mw.text.jsonDecode(mw.getCurrentFrame():expandTemplate{ title = 'Songlist' } )

function p.main()
	json = Gjson
	s = #json["songs"]
	return s
end

function p.test(key)
	local c
	if key==true then  c = 2 end
	if c==nil then return '无值' else return '有值' end
	
end

return p