highlight

package
v0.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL