From 01051b433eefbc097f6abe13f75bda18f3db81c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pant=C5=AF=C4=8Dek?= Date: Mon, 20 Mar 2023 22:28:33 +0100 Subject: [PATCH] Finish documenting ANSI and therefore all support modules. --- README.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/README.md b/README.md index cbdd35b..5c14e51 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,61 @@ implemented anyway to not require any external dependencies. ### ANSI +A simple module for creating ANSI (ECMA-48) sequence strings. + + (ansi . args) + +* ```args``` - a list of color/style keywords + +Produces an ANSI CSI (Control Sequence Introducer) SGR (Select Graphic +Rendition) strings with given attributes (re)set. + +It understands the following keywords: + +* ```#:black``` - black text foreground color +* ```#:red``` - red text foreground color +* ```#:green``` - green text foreground color +* ```#:yellow``` - yellow text foreground color +* ```#:blue``` - blue text foreground color +* ```#:magenta``` - magenta text foreground color +* ```#:cyan``` - cyan text foreground color +* ```#:white``` - white (grey) text foreground color +* ```#:default``` - reset all attributes to terminal defaults +* ```#:bold``` - bold font (and/or bright foreground color on some terminals) + +The order is important as the ```#:default``` resets all attributes +given even in the same attribute list. + + a:error + +Used to signal errors. Defaults to red bold text. + + a:warning + +Used to signal non-fatal warnings. Defaults to regular yellow text. + + a:success + +Signals success of an operation. Defaults to bold green text. + + a:neutral + +Used for generic text. Defaults to regular white (grey) text. + + a:default + +Special style which just resets the terminal output attributes to +terminal defaults. + + a:muted + +Used for displaying the text "muted" (dimmed). Defaults to bold/bright +black text. + + a:highlight + +Generic highlight of given text. Defaults to bold blue text. + ### Command Line parsing Generic syntax-based implementation of command-line options parsing