跳转到内容

Template:Tlg/doc

本页使用了标题或全文手工转换
轻之舟百科,让知识轻装启航

Template:Tlnull,常缩写为Template:Tlnull,其功能是为模板名称的显示提供样式化格式,而无需实际调用该模板。生成的代码将以行内形式呈现。

除Template:Mono外,所有命名参数均为开关型参数,它们通常可以省略,或通过赋值(如on、yes、true、include等)来激活。这些参数可按任意顺序排列(参见下方示例)。部分模板默认开启特定参数,所有可用的替代选项请查阅主表格。若某行显示效果与上一行完全相同,则表示当前模板不支持该选项,需改用模板链接:{{tlg}}实现。

参数 功能描述 与模板链接:{{example}}联用示例 默认激活的模板
默认状态(不使用任何辅助参数) {{example}}
brace 将双层大括号作为模板链接的一部分显示 {{example}} 模板链接:{{tlw}}/模板链接:{{tn}}
braceinside 将内层大括号作为模板链接的一部分显示 {{example}}
bold 将模板链接/名称以粗体形式显示 {{example}} 模板链接:{{tlb}}、模板链接:{{tlxb}}
code 使用HTML <code>...</code>标签(以等宽字体)显示输出 {{example}} 模板链接:{{tlc}}、模板链接:{{Template link expanded}}等
italic 将模板链接/名称之后的参数以斜体形式显示 {{example|param}} 模板链接:{{tlxi}}
kbd 使用HTML <kbd>...</kbd>标签(等宽字体)显示输出 {{example}}
nolink 不为模板名称添加内部链接 {{example}} 模板链接:{{tlf}}、模板链接:{{tnull}}
nowrap 在输出内容中禁用自动换行(nowrap) {{example}} 模板链接:{{tlf}}、模板链接:{{tlp}}
nowrapname 在模板名称/链接的输出中禁用自动换行(参数部分在必要时仍会换行) {{example}}
plaincode 使用样式为“border:none; background:transparent;”的<code>...</code>标签 {{example}} 模板链接:{{tltss}}
subst 在模板链接/名称前添加subst:前缀 {{subst:example}} 模板链接:{{tls}}、模板链接:{{tlxs}}等
alttext=[text] 将模板链接的显示文本替换为自定义文本[text] {{Other}} 模板链接:{{tla}}
_show_result 同时显示调用该模板后的实际渲染结果 {{Min|7|-5}} → -5
_expand 添加指向该模板展开后页面的链接 {{Min|7|-5}} [1]
a 在模板代码前添加一个星号(*) * {{Min|7|-5}}

匿名参数

[编辑源代码]

本模板可以接受不限数量的匿名参数,这些参数将作为模板链接(或名称)的附加参数一同显示;具体用法请参见下方示例。

Note
On the source sister projects, en.wikipedia and Meta, X0, X1, X2, …, X9 are sandbox templates for experimentation on involved templates that need be in template space. An auto-cleansing software facility exists that might be used to duplicate the facility on other Sister projects.
代码 输出 备注
模板链接:{{tlg|Example}} {{Example}}
模板链接:{{tlg|ExAmple}} {{ExAmple}} 模板名称区分大小写
模板链接:{{tlg|example}} {{example}} 首字母不区分大小写
模板链接:{{tlg|x0}} {{x0}}
模板链接:{{tlg|x0|code=on}} {{x0}} <code>样式
模板链接:{{tlg|x0|plaincode=on}} {{x0}} plaincode样式
模板链接:{{tlg|x0|bold=on}} {{x0}} 链接/名称加粗
模板链接:{{tlg|x1|one|italic=on}} {{x1|one}} 参数以斜体显示
模板链接:{{tlg|x0|nolink=on}} {{x0}}
模板链接:{{tlg|x0|subst=on}} {{subst:x0}}
模板链接:{{tlg|x0|braceinside=on}} {{x0}}
模板链接:{{tlg|x0|alttext=x0 link}} {{x0 link}}
模板链接:{{tlg|x0|bold=on|code=on|braceinside=on}} {{x0}} 可以组合使用多个参数设置
模板链接:{{tlg|x1|one}} {{x1|one}}
模板链接:{{tlg|x2|one|two}} {{x2|one|two}}
模板链接:{{tlg|x2|bold=on|code=on|one|two}} {{x2|one|two}} 可以组合使用命名参数和匿名参数……
模板链接:{{tlg|x2|one|two|bold=on|code=on}} {{x2|one|two}} ……以任意顺序……
模板链接:{{tlg|x2|one|code=on|two|bold=on|three}} {{x2|one|two|three}} ……甚至可以交错排列……
模板链接:{{tlg|x2|one|code=on|two|bold=on|three|italic=on}} {{x2|one|two|three}} ……并形成多种不同的配置。
模板链接:{{tlg|x3|1|2|3|4|5|6|7|8|9|10}} {{x3|1|2|3|4|5|6|7|8|9|10}}
模板链接:{{tlg}} {{Template:Tlg/doc}} 若无参数,则自动代入当前页面名称
模板链接:{{tlg|x1|x=u}} {{x1}} =符号无法直接使用
模板链接:{{tlg|x1|x&#61;u}} {{x1|x=u}}
&#61;可以正常使用
模板链接:{{tlg|x1|x{{=}}u}} {{x1|x=u}}
{{=}}可以正常使用
模板链接:{{tlg|x1|x<nowiki>=</nowiki>u}} {{x1|x=u}}
nowiki标签可以正常使用
模板链接:{{tlg|x2||two||}} {{x2|two}} 空参数同样有效,即使位于末尾
模板链接:{{tlg|x2|3=two|2=one}} {{x2|one|two}}
从右到左也可以正常处理
长名称的换行处理(默认情况)
代码 输出
模板链接:{{tlg|long template name that would wrap to new line|this is a long value for the 1st parameter that would wrap}} {{long template name that would wrap to new line|this is a long value for the 1st parameter that would wrap}}
长名称的换行处理(nowrap=on)
代码 输出
模板链接:{{tlg|nowrap: on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}} {{long template name that would wrap to new line|long value for the 1st parameter that would wrap}}
长名称的换行处理(nowrapname=on)
代码 输出
模板链接:{{tlg|nowrapname: on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}} {{long template name that would wrap to new line|long value for the 1st parameter that would wrap}}

Template:Tl-nav