Skip to content

pysan3/tuicrown

Repository files navigation

🌈 TuiCrown 👑

CI status Minimum supported Nim version License

Tuicrown is a Nim library for rich text and beautiful formatting in the terminal.

Generated with ./tests/test_all_rich_examples.nim.

image

This is possible with a very easy syntax as follows.

  • [style]: Styles are defined inside [ and ].
  • [/style]: / means to revert (undo) the style.
  • [/]: Reverts all style modification.

Such that...

let console = newTuiConsole(newTuiConsoleOptions()) # Console object with default options

console.print("[green]green text[/]")
console.print("[i]italic text[/]")
console.print("[i red]red and italic text[/]")
console.print("[u yellow]yellow and underlined,[/yellow] only color is removed,[i bg:blue] and now added italic with blue background")

image

Installation

❗ This is still in alpha stage.

  • API may change without notice.
nimble install https://github.com/pysan3/tuicrown
  • I will release this as a nimble package after v1.0.0+.
  • Coming soon!!
  • Check Milestone 0.99 for progress.

Usage

import tuicrown/tuiconsole

let console = newTuiConsole(newTuiConsoleOptions()) # Console object with default options

console.print("[i green]italic green text[/]")

Syntax

Tuicrown's syntax is inspired by the Rich python library.

Color

TODO: doc

  • Color
  • ForegroundColor
  • BackgroundColor

Style

TODO: doc

TODOs

  • Documentation
  • Tests
  • Windows support