Syntax Highlighting Guidelines
1 minute read
base16 is an architecture for building themes based on carefully chosen syntax highlighting using a base of sixteen colours. Base16 provides a set of guidelines detailing how to style syntax and how to code a builder for compiling base16 schemes and templates.
Rosely is not completely compatible with base16 (although it is possible to get base16 compliance by rearranging the colour palette) but a similar technique can be used for syntax highlighting. The aim is to group similar language constructs with a single color. For example, floats, ints, and doubles would belong to the same colour group.
The following are base16 guidelines for syntax highlighting adapted for Rosely (colours are selected from the ANSI palette to be consistent with syntax highlighting on terminal):
|Syntax highlighting elements
|Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted
|Integers, Boolean, Constants, XML Attributes, Markup Link Url
|Classes, Markup Bold, Search Text Background
|Strings, Inherited Class, Markup Code, Diff Inserted
|Support, Regular Expressions, Escape Characters, Markup Quotes
|Functions, Methods, Attribute IDs, Headings
|Keywords, Storage, Selector, Markup Italic, Diff Changed
|Deprecated, Opening/Closing Embedded Language Tags, e.g.