Help:Editing: Difference between revisions

imported>Mth
tables
imported>Wackbyte
make lang="..." examples more readable, add a wikitext example, and add a link to MediaWiki's own "Pages with syntax highlighting errors" page as it contains some useful info
Line 44: Line 44:
{{bc|<nowiki><syntaxhighlight lang="...">...</syntaxhighlight></nowiki>}}
{{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> treats {{ic|#}} as the beginning of a comment, as it is intended for scripts.
=== Examples ===
 
* <code>lang="nix"</code> can be used to highlight Nix expressions.
* <code>lang="html+handlebars"</code> may be used to highlight wikitext.
* 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> treats {{ic|#}} as the beginning of a comment, as it is intended for scripts.


== Using <code><cite /></code> ==
== Using <code><cite /></code> ==
Line 55: Line 59:
* [https://en.wikibooks.org/wiki/Editing_Wikitext Editing Wikitext, Wikibooks], a book about editing wikitext.
* [https://en.wikibooks.org/wiki/Editing_Wikitext Editing Wikitext, Wikibooks], a book about editing wikitext.
* [https://meta.wikimedia.org/wiki/Help:Section Help:Sections, Wikimedia]. While about the wikimedia wikis, these documents may help with some peculiarities about mediawiki.
* [https://meta.wikimedia.org/wiki/Help:Section Help:Sections, Wikimedia]. While about the wikimedia wikis, these documents may help with some peculiarities about mediawiki.
* [https://www.mediawiki.org/wiki/Category:Pages_with_syntax_highlighting_errors Category:Pages_with_syntax_highlighting_errors, MediaWiki], which describes several common syntax highlighting mistakes.