词条 | Module:Sandbox/Was a bee/Dump |
释义 | -- Copied from Wikidata. Main developer is RexxS. local p = {} -- internationalisationlocal i18n = {["warnDump"] = "", } function p.Dump(frame) local f = (frame.args[1] or frame.args.id) and frame or frame:getParent() local data = mw.wikibase.getEntityObject(f.args.id) local width = f.args.width or "100%" local height = f.args.height or "" local overflowY if (height ~= nil) and (height ~= "") then overflowY = "scroll" else overflowY = "" end --mw.logObject(height) --mw.logObject(overflowY) if not data then return i18n.warnDump end local pathText = frame:expandTemplate{ title = 'Q', args = { f.args.id } } .. " > " local i = 1 while true do local index = f.args[i] if (not index) or (index == "") then return pathText .. f:extensionTag{ name = 'syntaxhighlight', content = mw.dumpObject(data), args = {lang = "javascript", style = "width: " .. width .. ";" .. "height: " .. height .. ";" .. "overflow-y: " .. overflowY .. ";" .. "overflow-x: hidden;" } } .. i18n.warnDump end pathText = pathText .. index .. " > " data = data[index] or data[tonumber(index)] if not data then return i18n.warnDump end i = i + 1 end end return p 1 : Called function 'Dump' from module Wikidata |
随便看 |
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。