comfit-core 0.1.0

Comfit highlighting engine, theme model, and renderers
Documentation

comfit-core

Comfit highlighting engine, theme model, and renderers.

crates.io docs License: MIT

Documentation · crates.io

Installation

cargo add comfit-core --features render-html

Usage

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.

License

Licensed under the MIT License.