User blog:Kirkburn/Syntax highlighting - helping you read and write code



Greetings, Wikians!

As many of you know, 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. We're planning on introducing a feature called 'syntax highlighting', visible when editing the source code of an article, to help make this easier.

Essentially, syntax highlighting takes what is written on the page and highlights the various types of code in different colours to help a reader identify what part does what. For example, links are highlighted with a blue background, and templates become yellow.

We also plan to add a slightly different kind of highlighting to all CSS, JS and Lua module pages, much like you may already have seen on Special:CSS. These updated pages will also help you spot code issues, helping to prevent you from ending up with broken JavaScript, for example. It will be active on user-specific CSS and JS pages, too - such as Special:MyPage/global.js.

Both types of highlighting come with light and dark themes - so it should fit in well with your community's design.

Public beta!
We would like to run a beta test of the tool to collect feedback and check for bugs before we begin a global rollout of the new feature.

If you are an admin of a community and would like to test out this feature on your wikia, please let us know, either in the comments below or via Special:Contact/general. It is very easy for us to switch on and off, and has no lasting impact - it just makes some tweaks to the classic editor experience for all visitors.

The feature has already been live on a few communities for a couple of weeks - for example, it can be seen on Narutopedia, Encyclopedia SpongeBobia, American Horror Story Wiki and more!

Note that, at this point, we have not implemented a user preference for wikitext highlighting - but it is something we are planning to add before global rollout. A user preference allows users turn off wikitext highlighting - it can be found on the 'Editing' tab. Amongst other tweaks, we are also looking to add syntax highlighting to the source dialog in the VisualEditor in a future update.

Got feedback?
If you spot any bugs with the feature, it is best to let us know via Special:Contact/bug - and feel free to leave feedback below or via Special:Contact/feedback.

Thanks!

Known issues
''Last updated: 19 March 2015. Note: this is not an exhaustive list.''
 * If an article does not start with highlightable wikitext, or is a subpage, highlighting may be missing. Fixed in 18 March update!
 * There is no user preference to turn wikitext highlighting on and off. Added in 18 March update!
 * Highlighting does not currently appear in the VisualEditor's source dialog.
 * Highlighting might be misaligned on some pages - if you spot any examples, please let us know. Several examples fixed in 18 March update!
 * Syntax highlighting incorrectly reduced the line height in the source editor. This will be fixed in an upcoming update!
 * Syntax highlighting uses the dark theme on some light theme wikias. This will be fixed in an upcoming update!