tengri/tengri/README.md
2026-02-21 16:18:52 +02:00

2.1 KiB

tengri is a metaframework for building interactive applications with rust. (aren't we all?)

tengri is developed as part of tek, a music program for terminals.

tengri contains:

  • dizzle, a framework for defining domain-specific languages
  • output, an abstract UI layout framework
  • input, an abstract UI event framework
  • tui, an implementation of tengri over ratatui.

as well as:

  • core, the shared definitions ("utils") module
  • proc, the space for procedural macros
  • tengri, the top-level reexport crate

tengri is published under AGPL3.

Input

tengri_input is where tengri's input handling is defined.

the following items are provided:

  • Input trait, for defining for input sources
  • Handle trait and handle! macro, for defining input handlers
  • Command trait and the command! macro, for defining commands that inputs may result in

Output

tengri_output is an abstract interface layout framework.

it expresses the following notions:

  • space: Direction, Coordinate, Area, Size, Measure

  • output: Out, Draw, Content

    • the layout operators are generic over Draw and/or Content
    • the traits Draw and Content are generic over Out
    • implement Out to bring a layout to a new backend: see TuiOut in tengri_tui
  • layout:

    • conditionals: When, Either
    • iteration: Map
    • concatenation: Bsp
    • positioning: Align, Push, Pull
    • sizing: Fill, Fixed, Expand, Shrink, Min, Max
    • implement custom components (that may be backend-dependent): see tui_content in tengri_tui

TUI

tengri_tui implements tengri_output and tengri_input on top of ratatui and crossterm.

tengri is published under AGPL3.