Help:Editing: Difference between revisions
imported>Mth No edit summary |
imported>Mth Document how to typeset code |
||
| Line 46: | Line 46: | ||
| The last section, when needed, where <code><cite /></code> sections will output the references. | | The last section, when needed, where <code><cite /></code> sections will output the references. | ||
|} | |} | ||
== Code == | |||
Inline code can be typeset with {{ic|<nowiki>{{ic|...}}</nowiki>}} or <code><nowiki><code>...</code></nowiki></code>. A block of code is obtained with: | |||
{{bc|<nowiki>{{bc|...}}</nowiki>}} | |||
or | |||
{{bc|<nowiki><pre>...</pre></nowiki>}} | |||
or, often preferable: | |||
{{bc|<nowiki><syntaxhighlight lang="...">...</syntaxhighlight></nowiki>}} | |||
<code>lang="nix"</code> can be used to highlight Nix expressions. For console snippets, root prompts are conventionally indicated with {{ic|#}}, while non-root prompts look like {{ic|$}}. <code>lang="console"</code> highlights such prompts correctly, while <code>lang="bash"</code> rightfully treats {{ic|#}} as the beginning of a comment, as it is intended for scripts. | |||
== Using <code><cite /></code> == | == Using <code><cite /></code> == | ||