#![deny(missing_docs)]
mod error;
mod grammars;
mod registry;
mod scope;
mod themes;
mod highlight;
mod markdown_fence;
mod renderers;
mod tokenizer;
mod customization;
pub use error::Error;
pub use highlight::HighlightedText;
pub use markdown_fence::{ParsedFence, parse_markdown_fence};
pub use registry::{HighlightOptions, HighlightedCode, PLAIN_GRAMMAR_NAME, Registry};
pub use renderers::{RenderOptions, html::HtmlRenderer, terminal::TerminalRenderer};
pub use themes::{Color, CompiledTheme, FontStyle, Style, ThemeVariant};
pub const ZALO_CSS: &str = r#".z-l {
display: inline-block;
min-height: 1lh;
width: 100%;
}
.z-ln {
display: inline-block;
user-select: none;
margin-right: 0.4em;
padding: 0.4em;
min-width: 3ch;
text-align: right;
opacity: 0.8;
}
"#;
#[cfg(test)]
pub(crate) mod test_utils {
use crate::Registry;
use std::fs;
pub fn get_registry() -> Registry {
let mut registry = Registry::default();
for entry in fs::read_dir("grammars-themes/packages/tm-grammars/grammars").unwrap() {
let path = entry.unwrap().path();
registry.add_grammar_from_path(path).unwrap();
}
registry.link_grammars();
registry
.add_theme_from_path("grammars-themes/packages/tm-themes/themes/vitesse-black.json")
.unwrap();
registry
}
}