Jump to content

Template:Codenowiki/doc: Difference between revisions

From BattleIntelligence
imported>Deadfire
creation
 
m Text replacement - "BattleTechWiki" to "BattleIntelligence"
 
Line 17: Line 17:


===Embedded substitution===
===Embedded substitution===
If the template is [[BattleTechWiki:Transclusion|transcluded]] rather than substituted on a page, its output can be corrected by re-saving the page, triggering the substitution embedded within it:
If the template is [[BattleIntelligence:Transclusion|transcluded]] rather than substituted on a page, its output can be corrected by re-saving the page, triggering the substitution embedded within it:
: {{{{lc:{{BASEPAGENAME}}}} |1=Here be code}}
: {{{{lc:{{BASEPAGENAME}}}} |1=Here be code}}



Latest revision as of 00:11, 1 May 2025

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