Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Codenowiki/doc: Difference between revisions

Template page
No edit summary
Merge documentation from {{code}}
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
{{Template shortcut |Cono}}
{{Template shortcut
<includeonly>{{Notice |Ignore the code appearing above; it is not how the final result will display}}</includeonly>
| code
{{Subst only}}
| cono
}}
 
:''This has been copied from the English Wikipedia's Codenowiki template. Some features may be missing.''
:''This has been copied from the English Wikipedia's Codenowiki template. Some features may be missing.''
This template provides a speedy way to wrap template source code in {{tag|code|content={{tag|nowiki}}}} markup. To work correctly, '''it must be [[WP:SUBST|substituted]]'''.
This template provides a speedy way to wrap template source code in {{tag|code|content={{tag|nowiki}}}} markup.


===Example===
== Examples ==
: {{nowrap|<nowiki>{{subst:</nowiki>{{lc:{{BASEPAGENAME}}}}<nowiki> |1=Here be code}}</nowiki> ... outputs: ...&nbsp; <code><nowiki>Here be code</nowiki></code>}}
{| class="wikitable"
The code produced by the template for this output is:
! Code
: &lt;code&gt;&lt;nowiki&gt;Here be code&lt;/nowiki&gt;&lt;/code&gt;
! Result
! Remarks
|-
| {{code|1={{code{{!}}FOR i:=1 TO &#x221e; & beyond}}}}
| {{code|1=FOR i:=1 TO &#x221e; & beyond}}
|
|-
| {{code|{{code{{!}}&amp;lt;nowiki> ... &amp;lt;/nowiki>}}}}
| {{codef|&lt;nowiki> ... &lt;/nowiki>}}
| You can use {{code|&lt;nowiki>}} and {{code|&lt;/nowiki>}} tags in the argument if you escape them with {{code|&amp;lt;}}
|-
| {{code|{{code{{!}}<table>TEXT</table>}}}}
| {{code|<table>TEXT</table>}}
| Most other HTML/XML tags should work without escaping
|-
| {{code|{{code{{!}}{{shortcuts{{!}}COM:SCOPE}}}}}}
| {{code|{{shortcuts|COM:SCOPE}}}}
| rowspan="2" | Template calls may work if you escape the pipe character {{code|{{!}}}}
|-
| {{code|{{code{{!}}{{shortcuts{{((}}!{{))}}COM:SCOPE}}}}}}
| {{code|{{shortcuts{{!}}COM:SCOPE}}}}
|}


===Embedded substitution===
== Limitations ==
If the template is [[Wikipedia:Transclusion|transcluded]] rather than substituted on a page, its output can be corrected by re-saving the page, triggering the substitution embedded within it:
This template does not work with signatures. Typing {{tlxs|codenowiki|<nowiki>~~~~</nowiki>}} results in displaying your full signature's code.
: {{{{lc:{{BASEPAGENAME}}}} |1=Here be code}}


===Limitations===
== See also ==
This template does not work with signatures. Typing {{tlxs|codenowiki|<nowiki>~~~~</nowiki>}} results in displaying your full signature's code.
* {{tld|codef}} Same as this, but without the nowiki functionality, useful when the argument needs processing, e. g. italicizing


===See also===
{{Semantic markup templates}}
{{Semantic markup templates}}
 
<includeonly>{{Sandbox other||
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox |
| <!-- Categories below this line, please; interwikis at Wikidata -->
| <!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Semantic markup templates]]
[[Category:Semantic markup templates]]
[[Category:Typing-aid templates]]
[[Category:Typing-aid templates]]
}}</includeonly>
}}</includeonly>

Revision as of 01:52, 21 July 2021

This has been copied from the English Wikipedia's Codenowiki template. Some features may be missing.

This template provides a speedy way to wrap template source code in ‎<code>‎<nowiki>...‎</nowiki>‎</code> markup.

Examples

Code Result Remarks
{{code|FOR i:=1 TO ∞ & beyond}} FOR i:=1 TO ∞ & beyond
{{code|&lt;nowiki> ... &lt;/nowiki>}} <nowiki> ... </nowiki> You can use <nowiki> and </nowiki> tags in the argument if you escape them with &lt;
{{code|<table>TEXT</table>}} <table>TEXT</table> Most other HTML/XML tags should work without escaping
{{code|{{shortcuts|COM:SCOPE}}}} [[:Template:Shortcuts]] Template calls may work if you escape the pipe character |
{{code|{{shortcuts{{!}}COM:SCOPE}}}} {{shortcuts|COM:SCOPE}}

Limitations

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

See also

  • {{codef}} Same as this, but without the nowiki functionality, useful when the argument needs processing, e. g. italicizing

Template:Semantic markup templates

Cookies help us deliver our services. By using our services, you agree to our use of cookies.