docs: Add explanation of syntax highlighting configuration for CLI

This commit is contained in:
Max Brunsfeld 2020-02-21 11:16:06 -08:00
parent 1ce42a04a7
commit 709ddfebe9
2 changed files with 145 additions and 18 deletions

View file

@ -172,9 +172,21 @@ fn parse_style(style: &mut Style, json: Value) {
if let Value::Object(entries) = json {
for (property_name, value) in entries {
match property_name.as_str() {
"bold" => style.ansi = style.ansi.bold(),
"italic" => style.ansi = style.ansi.italic(),
"underline" => style.ansi = style.ansi.underline(),
"bold" => {
if value == Value::Bool(true) {
style.ansi = style.ansi.bold()
}
}
"italic" => {
if value == Value::Bool(true) {
style.ansi = style.ansi.italic()
}
}
"underline" => {
if value == Value::Bool(true) {
style.ansi = style.ansi.underline()
}
}
"color" => {
if let Some(color) = parse_color(value) {
style.ansi = style.ansi.fg(color);