comfit-core
Comfit highlighting engine, theme model, and renderers.
Installation
Usage
use ;
See the API reference for backend integration and the HTML guide for rendering options.
License
Licensed under the MIT License.
Comfit highlighting engine, theme model, and renderers.
cargo add comfit-core --features render-html
use comfit_core::{Highlighted, Line, RenderHtmlConfig, Token};
fn main() {
let highlighted = Highlighted {
lines: vec![Line {
number: 1,
highlighted: false,
tokens: vec![Token {
text: "fn",
highlight: Some("keyword.function"),
rainbow: None,
}],
}],
};
println!(
"{}",
highlighted.render_html_classes(&RenderHtmlConfig::default())
);
}
See the API reference for backend integration and the HTML guide for rendering options.
Licensed under the MIT License.