two-face

Dedicated to chasing the bat man

Extra syntax and theme definitions for syntect including many common ones that are missing from the default set like TOML, TypeScript, and Dockerfile. syntect embeds ~0.5 MiB of static assets for the default themes and styles, so it's best to use default-features = false when using this crate to avoid pulling in unused embedded assets.

Example

The following

toml [dependencies] syntect = { version = "0.5.0", default-features = false, features = ["html"] } two-face = "0.1.0"

```rust const TOML_TEXT: &str = "\ [section] key = 123 ";

fn main() { let synset = twoface::syntax::extra(); let themeset = twoface::theme::extra();

let syn_ref = syn_set.find_syntax_by_extension("toml").unwrap();
let theme = theme_set.get("Nord").unwrap();
let htmlified = syntect::html::highlighted_html_for_string(
    TOML_TEXT,
    &syn_set,
    syn_ref,
    theme
).unwrap();

println!("{htmlified}");

} ```

will print this

```html

[section]
key = 123

```

Legal

Most of the code for generating the syntax and theme dumps along with curating said syntax and themes is taken from bat. Because of this we also mirror bat's licenses by being dual licensed under MIT and Apache-2.0.

See the LICENSE-APACHE and LICENSE-MIT files for license details.

bat's NOTICE

Copyright (c) 2018-2021 bat-developers (https://github.com/sharkdp/bat).

bat is made available under the terms of either the MIT License or the Apache License 2.0, at your option.

See the LICENSE-APACHE and LICENSE-MIT files for license details.