hs-highlight-1.0.2: A tool to highlight terminal strings
Copyright(c) Lorenzobattistela 2024
LicenseMIT
Maintainerlorenzobattistela@gmail.com
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Highlight

Description

This module provides functions to highlight and format text in terminal output, particularly useful for displaying code snippets with error highlighting.

Synopsis

Documentation

highlightError :: (Int, Int) -> (Int, Int) -> String -> String Source #

Highlights an error in the given content between the specified start and end positions.

highlight :: (Int, Int) -> (Int, Int) -> String -> (String -> String) -> String -> String Source #

Highlights a portion of the given content between the specified start and end positions with a specified color and effect.

underline Source #

Arguments

:: String

Text to underline

-> String

Underlined text

Applies underline formatting to text using ANSI escape codes.

bold Source #

Arguments

:: String

Text to make bold

-> String

Bold text

Applies bold formatting to text using ANSI escape codes.

italic Source #

Arguments

:: String

Text to italicize

-> String

Italicized text

Applies italic formatting to text using ANSI escape codes.

parenthesize Source #

Arguments

:: String

Text to parenthesize

-> String

Parenthesized text

Wraps text in parentheses.

strikethrough Source #

Arguments

:: String

Text to strikethrough

-> String

Strikethrough text

Applies strikethrough formatting to text using ANSI escape codes.

inverse Source #

Arguments

:: String

Text to inverse

-> String

Inversed text

Applies inverse (reverse video) formatting to text using ANSI escape codes.

getColor Source #

Arguments

:: String

Color name

-> String

ANSI color code

Gets the ANSI color code for a given color name.