render-ansi
render-ansi converts highlighted byte spans and resolved styles into ANSI/VT escaped terminal text.
What It Provides
- End-to-end helpers:
highlight_to_ansi(...) -> Stringhighlight_lines_to_ansi_lines(...) -> Vec<String>
- Low-level render helpers:
resolve_styled_spans(...)render_ansi(...)render_ansi_lines(...)
Quick Example
use Grammar;
use highlight_to_ansi;
use load_theme;
When To Use This Crate
- Use this crate when you want terminal-ready ANSI output.
- If you have your own paint engine (for example native C/TUI), use
highlight-spans+theme-enginedirectly and skip ANSI rendering.