匿名
未登录
中文(中国大陆)
登录
Limbo Wiki
搜索
查看“模块:Out”的源代码
来自Limbo Wiki
命名空间
模块
讨论
更多
更多
页面操作
阅读
查看源代码
历史
←
模块:Out
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
local out = {} -- out模块 local content = "" function out.str(obj) -- 获取对象的字符串表示(似乎可以使用mw.logObject替代) local rv = "" if (type(obj)=="string") then rv = obj elseif (type(obj)=="boolean") then if obj then rv = "true" else rv = "false" end elseif (type(obj)=="number") then rv = "" .. obj elseif (type(obj)=="table") then rv = "{" for k, v in pairs(obj) do rv = rv .. out.str(k) .. ":" .. out.str(v) end rv = rv .. "}" else rv = "<type '"..type(obj).."'>" end return rv end function out.write(data) -- 不换行输出 content = content .. out.str(data) end function out.writeln(data) -- 换行输出 content = content .. out.str(data) .. "<br>" end function out.color(text, color) -- 文字颜色 return [[<span style="color:]] .. out.str(color) .. [[;">]]..out.str(text).."</span>" end function out.create_main(base) -- 装饰器:自动返回结果,建议使用 function warp(frame) base(frame) return frame:preprocess(content) -- 预处理,使html和模板生效 end return warp end -- 导入请使用 -- local out=require("Module:Out") return out
本页使用的模板:
模块:Out/doc
(
查看源代码
)
返回
模块:Out
。
导航
导航
首页
最近更改
随机页面
操作申请
帮助
入门指南
编辑指南
写作指南
随机
官方
碎数研
谜题保管所
Wiki工具
Wiki工具
特殊页面
页面工具
页面工具
用户页面工具
更多
链入页面
相关更改
页面信息
页面日志