Package Internals
Highlights
Module
Highlights.AbstractLexer
— Type.abstract type AbstractLexer
Represents a source code lexer used to tokenise text.
Highlights.AbstractTheme
— Type.abstract type AbstractTheme
Represents a colour scheme used to highlight tokenised source code.
Themes
Submodule
Highlights.Themes.RGB
— Type.struct RGB
Represents a single RGB colour value that can be 'active' or 'inactive'.
Highlights.Themes.Style
— Type.struct Style
An internal type used to track colour scheme definition information such as foreground and background colours as well as bold, italic, and underlining.
Highlights.Themes.Theme
— Type.struct Theme
Represents a "compiled" colour scheme.
Highlights.Themes.rgb3
— Method.Convert a three digit hex string to a 3-tuple of UInt8
s.
Highlights.Themes.rgb6
— Method.Convert a six digit hex string to a 3-tuple of UInt8
s.
Lexers
Submodule
Highlights.Lexers.words
— Method.words(vec; prefix, suffix)
Build a regular expression from a vector of strings. Useful for keyword lists.
The keyword arguments prefix
and suffix
can be used to add patterns before and after the main match group.
Examples
julia> import Highlights.Lexers: words
julia> words(["if", "else"])
r"(if|else)"
Highlights.Lexers.@raw_str
— Macro.A utility string macro to avoid having to escape strings used to build a regular expression.