hs-highlight-1.0.0: 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 Source #

Arguments

:: (Int, Int)

Start position (line, column)

-> (Int, Int)

End position (line, column)

-> String

The text content

-> String

The highlighted text

Highlights an error in the given text using red underline.

highlight Source #

Arguments

:: (Int, Int)

Start position (line, column)

-> (Int, Int)

End position (line, column)

-> String

Color name

-> String

The text content

-> (String -> String)

Effect function

-> String

The highlighted text

Highlights a portion of text 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.