Skip to main content

Crate comfit_core

Crate comfit_core 

Source
Expand description

Syntax highlighting and themes with optional HTML and ANSI rendering.

Implement backend::Backend to connect a parser to the highlighting engine. All source ranges use UTF-8 byte offsets. Highlighted tokens borrow the source and capture names from the highlighter.

Re-exports§

pub use document::Document;
pub use engine::Highlighter;
pub use engine::Queries;
pub use highlight::HighlightConfig;
pub use highlight::HighlightResult;
pub use highlight::Highlighted;
pub use highlight::Line;
pub use highlight::OwnedLine;
pub use highlight::OwnedToken;
pub use highlight::Token;
pub use theme::Color;
pub use theme::Modifier;
pub use theme::Style;
pub use theme::Theme;
pub use theme::Underline;
pub use theme::UnderlineStyle;

Modules§

backend
Parser adapters and query matches for the highlighting engine.
document
Source documents that reuse syntax trees and cache highlighting.
engine
Register languages and highlight source code, including embedded languages.
highlight
Evaluate parsed syntax layers and compose their highlights.
query
Compile query metadata and filter matches with custom predicates.
theme
Capture styles, terminal colors, and optional TOML theme loading.

Enums§

Error
Errors from language registration, parsing, highlighting, or theme loading.

Type Aliases§

RGB8
8-bit RGB