模板:Codenowiki/doc

来自决策链云智库
< 模板:Codenowiki
Zeroclanzhang讨论 | 贡献2024年1月21日 (日) 22:34的版本 (创建页面,内容为“{{Documentation subpage}} <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see Wikipedia:Wikidata) --> {{Template shortcut|CoNo|Cnw|pre1=subst:|pre2=subst:}} {{Intricate template}} {{Subst only|auto=yes}} {{Notice|Ignore the code appearing above; it is not how the final result will display}} This template provides a speedy way to wrap template source code in {{tag|code|content={{tag|nowiki}}}} markup. To wo…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

This template provides a speedy way to wrap template source code in code>>nowiki>>...</nowiki></code> markup. To work correctly, it must be substituted.

Recommended use is:

{{subst:codenowiki |1=(code)}}

The 1= is often necessary so that that anything before an equals sign in the code isn't interpreted as a parameter name.

Example

{{subst:codenowiki |1=Here be code}} ... outputs: ...  Here be code

The code produced by the template for this output is:

<code><nowiki>Here be code</nowiki></code>

Embedded substitution

If the template is transcluded rather than substituted on a page, its output can be corrected by re-saving the page, triggering the substitution embedded within it:

{{subst:Nowiki|Here be code}}

Limitations

This template does not work with signatures. Typing {{subst:codenowiki|~~~~}} results in displaying your full signature's code.

See also