Template:Codenowiki/doc: Difference between revisions
Template page
More actions
No edit summary |
Remove red-link transclusion of Template:Semantic markup templates (B3) |
||
| (6 intermediate revisions by 4 users not shown) | |||
| 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 | | {{Template shortcut | ||
| code | |||
| 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. | This template provides a speedy way to wrap template source code in {{tag|code|content={{tag|nowiki}}}} markup. | ||
=== | == Examples == | ||
{| class="wikitable" | |||
! Code | |||
! Result | |||
! Remarks | |||
|- | |||
| {{tld|nowrap=1|code|2=1=FOR i:=1 TO ∞ & beyond}} | |||
| {{code|1=FOR i:=1 TO ∞ & beyond}} | |||
| | |||
|- | |||
| {{tld|nowrap=1|code|&lt;nowiki> ... &lt;/nowiki>}} | |||
| {{codef|<nowiki> ... </nowiki>}} | |||
| You can use {{tag|nowiki|o}} and {{tag|nowiki|c}} tags in the argument if you escape them with <syntaxhighlight inline lang="html"><</syntaxhighlight> | |||
|- | |||
| {{tld|nowrap=1|code|{{#tag:span|{{tag|plain=1|table|content=TEXT}}|class=mw-highlight}}}} | |||
| {{code|<table>TEXT</table>}} | |||
| Most other HTML/XML tags should work without escaping | |||
|- | |||
| {{tld|nowrap=1|code|{{tlf|shortcuts|COM:SCOPE}}}} | |||
| {{code|{{shortcut|COM:SCOPE}}}} | |||
| rowspan="2" | Template calls may work if you escape the pipe character {{code|{{!}}}}, or the opening {{code|({{((}}}}) and closing brackets ({{code|{{))}}}}) | |||
|- | |||
| {{tld|nowrap=1|code|{{tld|((}}shortcuts{{magic word|!}}COM:SCOPE{{tld|))}}}} | |||
| {{code|{{((}}shortcuts{{!}}COM:SCOPE{{))}}}} | |||
|} | |||
== Limitations == | |||
This template does not work with signatures. Typing {{tlxs|codenowiki|<nowiki>~~~~</nowiki>}} results in displaying your full signature's code. | This template does not work with signatures. Typing {{tlxs|codenowiki|<nowiki>~~~~</nowiki>}} results in displaying your full signature's code. | ||
== See also == | |||
{{ | * {{tld|codef}} Same as this, but without the nowiki functionality, useful when the argument needs processing, e. g. italicizing | ||
* {{tld|pre}} | |||
* {{T|Syntaxhighlight}} | |||
<includeonly>{{ | <includeonly>{{Sandbox other|| | ||
<!-- 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> | ||
Latest revision as of 04:56, 11 August 2026
- 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> markup.
<nowiki>...</nowiki></code>
Examples
| Code | Result | Remarks |
|---|---|---|
| {{code|1=FOR i:=1 TO ∞ & beyond}} | FOR i:=1 TO ∞ & beyond
|
|
| {{code|<nowiki> ... </nowiki>}} | <nowiki> ... </nowiki>
|
You can use <nowiki> and </nowiki> tags in the argument if you escape them with <
|
| {{code|<table>TEXT</table>}} | <table>TEXT</table>
|
Most other HTML/XML tags should work without escaping |
| {{code|{{shortcuts|COM:SCOPE}}}} | <span id="shortcut" class="coordinates" style="display: inline; white-space:nowrap;">[[Commons:Shortcuts|Shortcut]]: [[:COM:SCOPE|COM:SCOPE]]</span>
|
Template calls may work if you escape the pipe character |, or the opening ({{) and closing brackets (}})
|
| {{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
- {{pre}}
- {{Syntaxhighlight}}