Minecraft Wiki沙盒
欢迎来到中文Minecraft Wiki的公共沙盒。您可以在此页面上进行测试性编辑,但我们仍然建议在此处进行有建设性的编辑或翻译较短的条目。要编辑此页面,请点击上方的“编辑”铅笔按钮,或点击此处。在进行更改后,您可以点击编辑框下面的“显示预览”按钮来预览您的编辑,然后在相同位置点击“保存页面”按钮来保存编辑。
请注意,对此页面的更改不会被长期保留,因为此页面仅供测试编辑或翻译较短的条目之用。您也可以创建此页面的子页面(例如,Module:Sandbox/测试)来进行长期的项目,但它们仍然会在社区认定其过期后被删除。任何不具建设性的内容随时都可能会被清理。另外,如果您已注册账号,可以在自己的个人页面下创建您的个人沙盒,并且不用担心您的编辑会被清理。
您在编辑包括本页面在内的所有Wiki页面时都必须遵守相关的Wiki条例、格式指导和书面汉语指导等规范指导,否则您的编辑会被回退,您也可能会遭到警告甚至封禁处理。若有任何疑问,请到讨论页或社区专页提出。若需要联系管理员,请到管理员告示板提出请求。
所有子页面:
- Module:Sandbox/doc
最后编辑于3年6天7小时53分前 - Module:Sandbox/tooBright
最后编辑于2年6周10小时25分前 - Module:Sandbox/Chixvv/LootChest/config
最后编辑于2年4周1天17小时29分前 - Module:Sandbox/Chixvv/LootChest
最后编辑于2年2周4天6小时22分前 - Module:Sandbox/Version nav
最后编辑于1年48周1天14小时29分前 - Module:Sandbox/AllConversion
最后编辑于1年39周4天13小时59分前 - Module:Sandbox/AllConversion/doc
最后编辑于1年39周4天13小时43分前 - Module:Sandbox/AllConversion2/JE IDs
最后编辑于1年38周15小时40分前 - Module:Sandbox/AllConversion2/BE Blocks
最后编辑于1年38周13小时8分前 - Module:Sandbox/AllConversion2/BE Items
最后编辑于1年36周6天14小时58分前 - Module:Sandbox/AllConversion2/BE lang
最后编辑于1年36周5天18小时16分前 - Module:Sandbox/AllConversion2/data
最后编辑于1年36周5天17小时10分前 - Module:Sandbox/AllConversion2/Data Table
最后编辑于1年36周5天13小时16分前 - Module:Sandbox/AllConversion2/JE lang
最后编辑于1年36周5天11小时48分前 - Module:Sandbox/AllConversion2
最后编辑于1年36周5天11小时48分前 - Module:Sandbox/Command/Syntax
最后编辑于1年30周2天13小时39分前 - Module:Sandbox/Anterdc99/Crafting
最后编辑于39周6天23小时53分前 - Module:Sandbox/Anterdc99/Crafting usage
最后编辑于39周6天23小时53分前 - Module:Sandbox/Anterdc99
最后编辑于29周2天12小时34分前 - Module:Sandbox/Infobox
最后编辑于20周1天16小时38分前 - Module:Sandbox/LootChest
最后编辑于18周4天23小时40分前 - Module:Sandbox/GetSubpages
最后编辑于13周1天22小时39分前 - Module:Sandbox/HistoryM
最后编辑于10周3天19小时28分前 - Module:Sandbox/AllConversion/data
最后编辑于5周4天13小时7分前 - Module:Sandbox/GetSubpages/doc
最后编辑于5周18小时14分前 - Module:Sandbox/AllConversion2/doc
最后编辑于3周1天20小时18分前
若上述页面信息不准确,请点击此处刷新页面。
local ProcessArgs = require('Module:ProcessArgs')
local p = {}
local function StripSpaceAndLineAtBothEnds(str)
return (string.gsub(str, '^[%s\n]*(.-)[%s\n]*$', '%1'))
end
local function StripKeyValuePairFromString(str)
local key, value
local point = string.find(str, ":", 1)
if point ~= nil then
key = StripSpaceAndLineAtBothEnds(string.sub(str, 1, point - 1))
value = StripSpaceAndLineAtBothEnds(string.sub(str, point + 1, string.len(str)))
else
key = StripSpaceAndLineAtBothEnds(str)
end
return key, value
end
local function StringToArray (str, splitter)
local rawSplit = mw.text.split(str, splitter)
local results = {}
for i,value in ipairs( rawSplit ) do
table.insert(results, StripSpaceAndLineAtBothEnds( value ) )
end
return results
end
function p.test(f)
local args = f
local frame = mw.getCurrentFrame()
if f == frame then
args = ProcessArgs.merge(true)
end
local results = {}
for tagsData, contentToTag in pairs(args) do
local tagTypes = StringToArray(tagsData, ';')
local appendTags = {}
for tagsData, contentToTag in pairs(args) do
local tagType, tagStrings = StripKeyValuePairFromString(tagsData)
local tags = StringToArray(tagStrings, ',')
table.insert(appendTags, frame:expandTemplate { title = tagType, args = tags })
end
table.insert(results, table.concat({
'<span style="background-color: var(--custom-background-blue);">',
contentToTag,
'</span>',
table.concat(appendTags)
}))
end
return mw.text.listToText(results, '、', '或')
end
return p