Skip to main content

highlight_code_to_ansi

Function highlight_code_to_ansi 

Source
pub fn highlight_code_to_ansi(
    code: &str,
    language: Option<&str>,
    theme_name: &str,
) -> Vec<String>
Expand description

Highlight a code string and return ANSI-formatted strings per line.

This is a convenience function that renders highlighting directly to ANSI escape sequences suitable for terminal output.