Help:Code snippets

From RationalWiki
Jump to navigation Jump to search

Code[edit]

For code snippets use <syntaxhighlight>. Instructions are already covered on the page linked; there is no need to rehash the basics. If the code snippet is very short use:, <code>, or <syntaxhighlight inline>. Don't forgot to close the tags. If the code still runs while being encased in <code> tags, add <nowiki> tags after the <code> tags.

There are cases where <pre> should be used, for instance where it is important to preserve whitespace.

<syntaxhighlight> does not have wikitext as a language option, use "HTML", "XML", "moin" for now. Moin is a different wiki markdown language[note 1] than what Mediawiki uses. It may be necessary to rotate between three languages to accurately imitate the syntax highlighting of wikitext.

For wikitext do not apply the line parameter. These examples use lang='moin'.

1We do ''not'' have numbers when editing in wikitext for articles
2===This looks fairly odd and baffling.===
3* Why would you add detail when it isn't needed for understanding?
'''Look''' how clean this looks.
#Fresh
#Simple
#Clean

Keyboard input[edit]

Use {{Key press}}.

HTML entities[edit]

Here is a list of HTML entities. HTML entities can be used to: make sure text sticks together or to enhance the typography of an article.

For adding the plain text of HTML entities such as £, type &amp;pound; which results in &pound;.

It looks better:

(c) vs ©
&pound;
Num. vs №
&#8470;
-- vs —
&mdash;

See also[edit]

Notes[edit]