Copyright | (c) Lorenzobattistela 2024 |
---|---|
License | MIT |
Maintainer | lorenzobattistela@gmail.com |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Highlight
Description
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
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.
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.
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.