clifmt/README.md

1.7 KiB

| extended terminal format |

Go version Go Report Card Go doc

Simple utility written in go that extends the standard fmt.Sprintf and fmt.Printf functions. It allows you to set foreground/background color, bold, underlined and italic text.


(1) Format

Base format
${<target text>}(<fg>:<bg>)
  • <target text> is the text that will be colorized.
  • <fg> is the name of the foreground color (c.f. color list), or an hex color (e.g.#00ffaa, #0fa).
  • <bg> is the name of the background color with the same syntax as for the foreground.

Note that it is not recommended to nest the different coloring formats.

Foreground only
${<target text>}(<fg>)
  • <target text> is the text that will be colorized.
  • <fg> is the name of the foreground color.
Background only
${<target text>}(:<bg>)
  • <target text> is the text that will be colorized.
  • <bg> is the name of the background color.

(2) Screenshot

default screenshot


(3) Incoming features

  • markdown-like formatting - bold, italic, underlined, (strike-through?)
  • global alignment - align text dynamically
  • progress-line - redrawing format to show, for instance an animated progress bar on the same line