首頁
隨機
登入
設定
關於合眾百科 Unitedbook
免責聲明
搜尋
正在編輯
模組:WikitextLC
警告:
您尚未登入。 若您進行任何的編輯您的 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
(
編輯
)