匿名
未登录
中文(中国大陆)
登录
「荏苒之境」
搜索
查看“︁模块:Gloss”︁的源代码
来自「荏苒之境」
命名空间
模块
讨论
更多
更多
页面操作
阅读
查看源代码
历史
清除缓存
←
模块:Gloss
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
local utils_str = require("Module:Utils/String") local gloss = {} local function split(text, delimiters) local parts = {} for part in string.gmatch(text, "([^"..delimiters.."]+)") do parts[#parts+1] = part end return parts end local function format_tooltip(t, text, tip) if tip ~= "" and tip ~= nil then t[#t+1] = "{{#tip-text:" t[#t+1] = text t[#t+1] = "|" t[#t+1] = tip t[#t+1] = "}}" else t[#t+1] = text end end gloss.show = function(frame) local text = frame.args[1] local tips = utils_str.unlines(frame:preprocess(frame.args[2]), "\n;") local t = {} local i = 1 local mode = frame.args.mode if mode == nil or mode == "" or mode == "空格" then for word in string.gmatch(text, "([^ ]+)") do if word ~= "" then format_tooltip(t, word, tips[i]) i = i + 1 end t[#t+1] = " " end t[#t+1] = nil elseif mode == "分隔符" then local delimiter = frame.args.delimiter if delimiter == nil or delimiter == "" then delimiter = ";" end for word in string.gmatch(text, "([^"..delimiter.."]+)") do if word ~= "" then format_tooltip(t, word, tips[i]) i = i + 1 end end end return frame:preprocess(table.concat(t)) end return gloss
该页面使用的模板:
模块:Gloss/doc
(
查看源代码
)
返回
模块:Gloss
。
导航
导航
首页
最近更改
随机页面
特殊页面
wiki工具
wiki工具
Cargo数据
页面工具
页面工具
用户页面工具
更多
链入页面
相关更改
页面信息
页面日志