Documentation
¶
Overview ¶
Package highlight colors the code blocks of a TextView with chroma's lexers and NSH's reading palette, light and dark. It is a package of its own because chroma's lexers add about 4.5 MB to an app.
textview.TextView{Markdown: reply, Highlighter: highlight.New(cx)}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(cx *core.Scope) textview.Highlighter
New returns a highlighter colored for the system's appearance, so an appearance change colors the code again without lexing it again. A language chroma does not know leaves the code plain.
Lexing stays off the engine goroutine unless it is cheap: a block lexed before is colored from the cache, and one whose language lexes fast enough to take under 2 ms is lexed on the spot. Others show at once, plain or with the colors of a block they grew from (code that streams in), and are lexed on a goroutine of their own; the result colors them again.
Types ¶
This section is empty.