Difference between revisions of "Template:Code"

From Wiki
Jump to navigation Jump to search
(Try to fix a problem with equals signs)
(Explain what to do if the code contains equals signs)
Line 1: Line 1:
<code>{{{1}}}{{{2}}}</code><noinclude>
+
<code>{{{1}}}</code><noinclude>
 
----
 
----
  
Print inline code, but wrapping it in a template makes changing easier. To handle bits of <code>a=b</code> code:
+
Print inline code, but wrapping it in a template makes changing easier. If the code contains any equal sign at all, use this idiom:
  
    <nowiki>{{code|location|=stuff}}</nowiki>
+
  <nowiki>{{code|stuff}}            % most cases
 +
  {{code|1=location=stuff}} % if there is any equals sign at all in the code</nowiki>
 +
 
 +
or fall back on the {{code|<code>...&lt;/code>}} tags.
  
 
</noinclude>
 
</noinclude>

Revision as of 02:37, 2 July 2012

{{{1}}}


Print inline code, but wrapping it in a template makes changing easier. If the code contains any equal sign at all, use this idiom:

  {{code|stuff}}            % most cases
  {{code|1=location=stuff}} % if there is any equals sign at all in the code

or fall back on the ...</code> tags.