Tt
Talk0
1,599pages on
this wiki
this wiki
Template page
Revision as of 08:26, September 9, 2010 by JohnBeckett (Talk | contribs)
These templates can be used in a tip to create no-wrap code samples.
Our style is to use tt tags to display code samples within other text. For example, <tt>:echo 'An example'</tt> displays as :echo 'An example'. See the code guidelines.
The templates documented here can be used when the code sample contains spaces that might wrap. This is an alternative to using to replace each space within the code sample.
Usage examples
| Wikitext | Displays as | Description |
|---|---|---|
| Enter {{tt|:Sample arg1 arg2}} to test. | Enter :Sample arg1 arg2 to test. | Where text contains no = or | characters. |
| Enter {{tt|1=:let myvar = 'hello'}} to test. | Enter :let myvar = 'hello' to test. | Where text contains one or more = but no | characters. |
| Enter {{ttbegin}}:let myvar = 'a=b|c/d\e'{{ttend}} to test. | Enter :let myvar = 'a=b|c/d\e' to test. | Where text contains any characters. |
| Enter {{ttnowiki|:Sample <u>arg1</u> ''arg2''}} to test. | Enter :Sample <u>arg1</u> ''arg2'' to test. | Where text contains no = or | characters, and interpretation as wikitext is not wanted. |
| Enter {{tt|:Sample <u>arg1</u> ''arg2''}} to test. | Enter :Sample arg1 arg2 to test. | Previous example using {{tt}} showing how wikitext is displayed. |