Difference between revisions of "Template:InlineCode"

(testing how to get all following text to '''not''' be in a pre...)
(Added documentation that fixes problem.)
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
<div class="noprint" style="white-space: nowrap; float: right;"></div>
+
<includeonly><span style="font:12px/12px monospace;background-color:#f9f9f9">{{{1}}} </span></includeonly>
<pre<noinclude></noinclude> style="display:inline;padding:0;line-height:inherit;border:none;margin:0 1px;">{{{1}}}</pre<noinclude></noinclude>>
+
<noinclude>==How to use this template==
<div></div>
+
This template is for displaying inline code. Just place <nowiki>{{InlineCode|<Code>}}</nowiki> with &lt;Code&gt; as the code you wish to display. Do '''NOT''' place trailing space(s). In other words, this is fine:
  
<noinclude>
+
<pre style="white-space:normal;">Lorem ipsum {{InlineCode|dolor}}sit amet. No trailing space after template.</pre>
===How to use this template===
+
 
<strike>This template is for displaying inline code. Just place <nowiki>{{InlineCode|<Code>}}</nowiki> with &lt;Code&gt; as the code you wish to display.</strike>
+
This is not:
Don't use it yet; somehow all following text gets put into a pre.</noinclude>
+
 
 +
<pre style="white-space:normal;">Lorem ipsum {{InlineCode|dolor}} sit amet. Trailing space after template will make the rest of the paragraph look bad.</pre>
 +
 
 +
Also, convert all angled brackets (&lt;,&gt;) into their respective HTML entities ({{InlineCode|&amp;lt;}}, {{InlineCode|&amp;gt;}}). Failure to do so carries the risk of making everything else look bad.</noinclude>

Latest revision as of 15:07, 24 January 2014

How to use this template

This template is for displaying inline code. Just place {{InlineCode|<Code>}} with <Code> as the code you wish to display. Do NOT place trailing space(s). In other words, this is fine:

Lorem ipsum {{InlineCode|dolor}}sit amet. No trailing space after template.

This is not:

Lorem ipsum {{InlineCode|dolor}} sit amet. Trailing space after template will make the rest of the paragraph look bad.

Also, convert all angled brackets (<,>) into their respective HTML entities (&lt; , &gt; ). Failure to do so carries the risk of making everything else look bad.