Help:Syntax highlighting

Syntax highlighting is a feature designed to improve readability of code on Wikia. It takes what is written in the editor and highlights the various types of code in different colours to help a reader identify which parts do what.

It exists in three main forms - simple wikitext highlighting, CSS/JS/template/Lua page highlighting, and as a tag usable on articles.

Simple wikitext highlighting
Wikitext is the main building block of articles across Wikia, but it can often be hard to comprehend what you're seeing at a glance, especially on more complex pages.

Syntax highlighting takes this code and adds blocks of colour behind the text. The main colors involved are:
 * blue-violet = section headings, bold and italic text
 * light blue = internal links
 * pale blue = external links
 * red = general wikitext
 * red-violet = tags
 * grey/brown = templates

CSS, JS, infobox template and Lua highlighting
CSS, JS, infobox templates, and Lua module pages have a more advanced syntax highlighter active.

Beyond simple readability improvements, the highlighting will also help you spot code issues - helping to prevent JavaScript errors, for example.

User preference
If you do not wish to use syntax highlighting, simply visit the 'Editing' tab in your preferences, and tick the "Do not show syntax highlighting in Source mode" option.

This will switch off all forms of syntax highlighting, including on CSS and JS pages.

Article highlighting
The &lt;syntaxhighlight> tag can be used on articles to syntax highlight sections of code for readers. A rough list of supported languages can be found here, on MediaWiki.org.

For example, CSS highlighting:

creates:

Further help and feedback
de:Hilfe:Syntaxhervorhebung es:Ayuda:Resaltado de sintaxis fi:Ohje:Koodin väritys fr:Aide:Coloration syntaxique it:Aiuto:Syntax highlighting ja:ヘルプ:シンタックスハイライト ko:도움말:구문 강조 nl:Help:Syntax markering pl:Pomoc:Podświetlanie składni pt:Ajuda:Realce de Sintaxe ru:Справка:Подсветка синтаксиса zh:Help:語法突顯