https://github.com/pysan3/tuicrown
Tuicrown is a Nim library for rich text and beautiful formatting in the terminal.
https://github.com/pysan3/tuicrown
ansi-colors nim nim-lang rich rich-text terminal terminal-color tui
Last synced: about 1 month ago
JSON representation
Tuicrown is a Nim library for rich text and beautiful formatting in the terminal.
- Host: GitHub
- URL: https://github.com/pysan3/tuicrown
- Owner: pysan3
- License: mpl-2.0
- Created: 2023-05-02T20:19:25.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-29T11:31:39.000Z (over 1 year ago)
- Last Synced: 2025-04-09T16:20:40.133Z (about 1 month ago)
- Topics: ansi-colors, nim, nim-lang, rich, rich-text, terminal, terminal-color, tui
- Language: Nim
- Homepage: https://pysan3.github.io/tuicrown/
- Size: 276 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 🌈 TuiCrown 👑
[](https://github.com/pysan3/tuicrown/actions?query=workflow%3ACI)

[](#license)- [API documentation](https://pysan3.github.io/tuicrown/)
Tuicrown is a Nim library for rich text and beautiful formatting in the terminal.
> Generated with [`./tests/test_all_rich_examples.nim`](./tests/test_all_rich_examples.nim).

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...
```nim
let console = newTuiConsole(newTuiConsoleOptions()) # Console object with default optionsconsole.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")
```
## Installation
❗ This is still in alpha stage.
- API may change without notice.
```bash
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](https://github.com/pysan3/tuicrown/milestone/1) for progress.## Usage
```nim
import tuicrown/tuiconsolelet console = newTuiConsole(newTuiConsoleOptions()) # Console object with default options
console.print("[i green]italic green text[/]")
```## Syntax
[`Tuicrown`](https://github.com/pysan3/tuicrown)'s syntax is inspired by the [Rich](https://github.com/Textualize/rich) python library.
### Color
TODO: doc
- Color
- ForegroundColor
- BackgroundColor### Style
TODO: doc
## TODOs
- [ ] Documentation
- [ ] Tests
- [ ] Windows support