跳至內容
主選單
主選單
移至側邊欄
隱藏
導覽
首頁
最近修改
分類索引
隨機頁面
貢獻分數
建立新頁面
工具
上傳檔案
特殊頁面
搜尋
搜尋
建立賬號
登入
個人工具
暗色模式
建立賬號
登入
用於已登出編輯者的頁面
了解更多
貢獻
討論
正在編輯
模組:WikitextLC
模組
討論
English
閱讀
編輯原始碼
檢視歷史
工具
工具
移至側邊欄
隱藏
操作
閱讀
編輯原始碼
檢視歷史
一般
連結至此的頁面
相關變更
特殊頁面
頁面資訊
取得短網址
警告:
您尚未登入。 若您進行任何的編輯您的 IP 位址將會被公開。 若您
登入
或
建立帳號
,您的編輯將會以您的使用者名稱標示,並能擁有另外的益處。
防垃圾訊息檢查用。
請勿
填寫此欄位!
local p = {} --- Construct an inline conversion from a table input. -- @param content table of the form -- { ["zh-cn"]='foobar', ["zh-tw"]='firecat', ["zh-hk"]='' } -- @returns string -- "-{zh-cn:foobar;zh-tw:firecat;zh-hk:<span></span>}-" -- -- @fixme allow for generating output without "-{" "}-", so that -- it can be used with the last three wrappers. function p.selective( content ) local text = '-{' for variant, value in pairs( content ) do if value == '' then value = '<span></span>' end text = text .. variant .. ':' .. value .. ';' end text = text .. '}-' return text end --- Write some text with a limited set of variants to convert to -- -- @param content text to be written -- @param variant a variant (string), or a list of variants -- (semicolon-deliminated string, or table of strings) -- @param[opt] force convert even under "zh" (no conversion) locale function p.converted( content, variant, force ) if type( variant ) == 'table' then variant = table.concat( variant, ';' ) end return '-{' .. ( force and '' or 'zh;' ) .. variant .. '|' .. content .. '}-' end --- Wraps some "raw text" to not convert. -- -- @fixme Is the "R" flag some undocumented/undefined no-op magic? -- Are we using it instead of the old '-{' .. content .. '}-' -- to avoid confusion caused by a flag in the "content"? function p.raw( content ) return '-{R|' .. content .. '}-' end --- Wraps a title conversion rule. function p.title( content ) return '-{T|' .. content .. '}-' end --- Wraps a (hidden) conversion rule definition. function p.hidden( content ) return '-{H|' .. content .. '}-' end return p
摘要:
請注意,所有於合眾百科 Unitedbook所做的貢獻會依據CC BY-NC-SA(創用CC 姓名標示─非商業性─相同方式分享)授權條款發佈(詳情請見
合眾百科 Unitedbook:版權
)。若您不希望您的著作被任意修改與散佈,請勿在此發表文章。
您同時向我們保證在此的著作內容是您自行撰寫,或是取自不受版權保護的公開領域或自由資源。
請勿在未經授權的情況下發表文章!
取消
編輯說明
(在新視窗開啟)
此頁面使用了以下模板:
模組:WikitextLC/doc
(
編輯
)
切換限制內容寬度