Copyright | (c) Lorenzobattistela 2024 |
---|---|
License | MIT |
Maintainer | lorenzobattistela@gmail.com |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This module provides functions to highlight and format text in terminal output, particularly useful for displaying code snippets with error highlighting.
Synopsis
- highlightError :: (Int, Int) -> (Int, Int) -> String -> String
- highlight :: (Int, Int) -> (Int, Int) -> String -> (String -> String) -> String -> String
- underline :: String -> String
- bold :: String -> String
- italic :: String -> String
- parenthesize :: String -> String
- strikethrough :: String -> String
- inverse :: String -> String
- getColor :: String -> String
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.
Applies underline formatting to text using ANSI escape codes.
Applies bold formatting to text using ANSI escape codes.
Applies italic formatting to text using ANSI escape codes.
Wraps text in parentheses.
Applies strikethrough formatting to text using ANSI escape codes.
Applies inverse (reverse video) formatting to text using ANSI escape codes.