Template:Code: Difference between revisions
Appearance
Created page with "<noinclude>{{documentation}} == Usage == This template displays text in a monospace code format, useful for showing code snippets, commands, or technical text inline. === Examples === * <code><nowiki>{{Code|print("Hello World")}}</nowiki></code> → {{Code|print("Hello World")}} * <code><nowiki>{{Code|sudo apt-get install}}</nowiki></code> → {{Code|sudo apt-get install}} * <code><nowiki>{{Code|var x = 10;}}</nowiki></code> → {{Code|var x = 10;}} * <code><nowiki>Use..." |
m Protected "Template:Code" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)) |
(No difference)
| |
Latest revision as of 09:25, 4 November 2025
Template documentation
|
|---|
| Note: portions of the template sample may not be visible without values provided. |
| View or edit this documentation. (About template documentation) |
| Editors can experiment in this template's sandbox and test case pages. |
Usage
This template displays text in a monospace code format, useful for showing code snippets, commands, or technical text inline.
Examples
{{Code|print("Hello World")}}→print("Hello World"){{Code|sudo apt-get install}}→sudo apt-get install{{Code|var x = 10;}}→Use {{Code|cd /home/user}} to change directory→ Usecd /home/userto change directory
Parameters
- 1 (required): The text to display in code format
- 2 (optional): Programming language (for documentation purposes)