Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 25 days 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 (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-29T11:31:39.000Z (over 1 year ago)
- Last Synced: 2023-10-29T12:25:33.580Z (over 1 year ago)
- Topics: ansi-colors, nim, nim-lang, rich, rich-text, terminal, terminal-color, tui
- Language: Nim
- Homepage: https://pysan3.github.io/tuicrown/
- Size: 279 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 🌈 TuiCrown 👑
[![CI status](https://github.com/alaviss/union/workflows/CI/badge.svg)](https://github.com/pysan3/tuicrown/actions?query=workflow%3ACI)
![Minimum supported Nim version](https://img.shields.io/badge/nim-1.9.3%2B-informational?style=flat&logo=nim)
[![License](https://img.shields.io/github/license/pysan3/tuicrown?style=flat)](#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).
![image](https://github.com/pysan3/tuicrown/assets/41065736/da5c9d30-bac9-42b3-b5c4-2856593a2dc2)
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")
```![image](https://user-images.githubusercontent.com/41065736/236800422-1fbe16bb-2cfd-408f-bbf4-bf2db48ddfbf.png)
## 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