Template:Codenowiki/doc: Difference between revisions

From Unofficial Homecoming Wiki
Jump to navigation Jump to search
m (gah, fix own typo in Category:Formatting Templates)
m (gah, fix own examples on doc page)
Line 2: Line 2:
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
=Documentation=
=Documentation=
<big>{{tl|codenowiki}}</big> is a shorthand notation to enclose the single parameter text inside both the <code><code></code> and <code><nowiki><nowiki></nowiki></code> tags.  It is most useful when making a reference to a tag itself, such as code or nowiki.
<big>{{tl|codenowiki}}</big> is a shorthand notation to enclose the single parameter text inside both the <code><nowiki><code></nowiki></code> and <code><nowiki><nowiki></nowiki></code> tags.   


'''This template must be subst:'''
It is most useful when displaying wikisyntax to a user, say on a template documentation page, without actually evaluating the template code.
 
'''This template must always be entered with the subst: prefix'''
   
   
== Usage ==
== Usage ==
<pre>
<code><nowiki>{{ subst:codenowiki | string to code-icize }}</nowiki></code>
{{ subst:codenowiki | string to code-icize }}
</pre>


== Examples ==
== Examples ==
Line 16: Line 16:
! Result
! Result
|-
|-
| <pre>{{subst:codenowiki|this is a test of <code> the quick brown fox}}</pre>
| <pre>{{subst:codenowiki|[[Category:Archetypes]]}}</pre>
| <big><code></noinclude><nowiki>this is a test of the <code> quick brown fox</nowiki>
| <big><code></noinclude><nowiki>[[Category:Archetypes]]</nowiki>
 
|-
| <pre>{{subst:codenowiki|{{wip|date={{subst:Today}}}}}}</pre>
| <big><code></noinclude><nowiki>{{wip|date={{subst:Today}}}}</nowiki>
|}
|}
----
----
Line 26: Line 28:
<!-- ADD CATEGORIES BELOW THIS LINE -->
<!-- ADD CATEGORIES BELOW THIS LINE -->
[[Category:Formatting Templates|{{PAGENAME}}]]
[[Category:Formatting Templates|{{PAGENAME}}]]
<!-- ADD INTERWIKIS BELOW THIS LINE -->
</includeonly>
</includeonly>

Revision as of 14:54, 26 August 2020

Template:Template doc page viewed directly

Documentation

{{codenowiki}} is a shorthand notation to enclose the single parameter text inside both the <code> and <nowiki> tags.

It is most useful when displaying wikisyntax to a user, say on a template documentation page, without actually evaluating the template code.

This template must always be entered with the subst: prefix

Usage

{{ subst:codenowiki | string to code-icize }}

Examples

Codenowiki Result
{{subst:codenowiki|[[Category:Archetypes]]}}
[[Category:Archetypes]]
{{subst:codenowiki|{{wip|date={{subst:Today}}}}}}
{{wip|date={{subst:Today}}}}

  • This template is a self-reference and so is part of the Unofficial Homecoming Wiki project rather than the content itself.