Rust TUI library - Clipping region is a set of min/max x/y values applied to the existing region

Related tags

Command-line tinybit
Overview

TinyBit

Clipping region is a set of min/max x/y values applied to the existing region

A TUI lib

This is not yet production ready

T O D O

TODO: bugs:

  • Text in template can be interpreted as attribute: text: "this:is_wrong"
  • Style propagation is entirely nonsense
  • Text widget is eating newline characters
  • Padding is wrapping the element but should wrap the child
    • How should padding behave when there are more than one child? * Add a container with padding and a node of the same type as self and move all the children into that node? * Don't allow padding as a property * Rename padding to margin

TODO:

TODO: Template

  • Custom widgets
    • impl of Widget
    • Register custom widgets with some lookup table
    • Custom template
    • Composition / includes

TODO: Optimisations

  • Don't layout widgets outside of constraints
  • Don't paint widgets outside of clipping / viewable space
  • Text widget can store indices for sub strings

NOTE: misc ideas

  • Pass json + template = render

Important:

  • Styles do not cascade, and has to be reset between elements
  • Width / height requirements for Viewport

Layout flow

Constraints -> Size -> Global pos

  1. Parent passes constraints down to the child,
  2. the child returns its size,
  3. the parent sets the position.

Template syntax

// is a comment

The first element can not have any indentation

container [width:10, height:5]:

Attributes

Attributes are written between [ and ]

String

string: "string value"

Number (i64)

num: 123

Boolean

bool_a: true, bool_b: false

Colour

TODO: list available colour names

foreground: red, background: reset, color: (10, 20, 30)
You might also like...
Library uses file-based mmap to store key-values

Library uses file-based mmap to store key-values This is a Rust version of MMKV. By default, this lib uses CRC8 to check data integrity. If include fe

Eventually consistent values for Rust

Eventuals give you the most up-to-date snapshots of some value. They are like Futures that update over time, continually resolving to an eventually co

Generic extensions for tapping values in Rust.

tap Suffix-Position Pipeline Behavior This crate provides extension methods on all types that allow transparent, temporary, inspection/mutation (tappi

Microsoft Excel (XLSX) to Unicode Separated Values (USV) Rust crate

xlsx-to-usv Convert Microsoft Excel (XLSX) to Unicode Separated Values (USV). Built with the USV Rust crate. Syntax: stdin | xlsx-to-usv [options] | s

Padding/aligning values without heap allocation

zero-copy-pads Padding/aligning values without heap allocation. Cargo Features std (default feature): Disable #![no_std]. Enable features that require

Quickly save and retrieve values for shell scripts.

Quickly save and retrieve values for shell scripts.

a crate to swap values between possibly-overlapping references

omniswap: a crate to swap values between possibly-overlapping references Motivating Example You cannot simply use std::mem::swap to replace values wit

Encode and decode dynamically constructed values of arbitrary shapes to/from SCALE bytes

scale-value · This crate provides a Value type, which is a runtime representation that is compatible with scale_info::TypeDef. It somewhat analogous t

A command line tool that resembles a debugger as well as Cheat Engine, to search for values in memory
A command line tool that resembles a debugger as well as Cheat Engine, to search for values in memory

Summary This is a small command-line tool designed to peek around memory of a running Linux process. It also provides filtering mechanisms similar to

Owner
Togglebit
Togglebit
A lightweight, zero-dependency struct diffing library which allows changed fields to be collected and applied

structdiff A lightweight, zero-dependency struct diffing library which allows changed fields to be collected and applied. Derive Difference on a struc

null 7 Dec 25, 2022
Efficient scan conversion of a line segment with clipping to a rectangular window.

✂️ clipline ?? clipline is a Rust crate for efficient scan conversion of a line segment with clipping to a rectangular window. It is an implementation

Nurzhan Sakén 5 Oct 26, 2023
🍅 A command-line tool to get and set values in toml files while preserving comments and formatting

tomato Get, set, and delete values in TOML files while preserving comments and formatting. That's it. That's the feature set. I wrote tomato to satisf

C J Silverio 15 Dec 23, 2022
A template for bootstrapping a Rust TUI application with tui-rs & crossterm

rust-tui-template A template for bootstrapping a Rust TUI application with tui-rs & crossterm. tui-rs The library is based on the principle of immedia

Orhun Parmaksız 72 Dec 31, 2022
Given a set of kmers (fasta format) and a set of sequences (fasta format), this tool will extract the sequences containing the kmers.

Kmer2sequences Description Given a set of kmers (fasta / fastq [.gz] format) and a set of sequences (fasta / fastq [.gz] format), this tool will extra

Pierre Peterlongo 22 Sep 16, 2023
A curated list of replacements for existing software written in Rust

Awesome Alternatives in Rust A curated list of replacements for existing software written in Rust. If you want to contribute, please read CONTRIBUTING

Takayuki Maeda 2.7k Jan 8, 2023
A user-friendly re-implementation of existing hex tools in Rust

Hex A project to create alternate (and more user friendly) versions of existing hex tools. The project can be installed as a extension to the github-c

Sohom Datta 6 Sep 27, 2022
🐢 Atuin replaces your existing shell history with a SQLite database, and records additional context for your commands

Atuin replaces your existing shell history with a SQLite database, and records additional context for your commands. Additionally, it provides optional and fully encrypted synchronisation of your history between machines, via an Atuin server.

Ellie Huxtable 4.6k Jan 1, 2023
📦 Distribute Roblox games as standalone executables -- No existing client necessary. 🚧

?? Packer Distribute Roblox games as standalone executables. ?? Packer is still being worked on. Among many other things, Windows is not currently sup

Brooke Rhodes 16 Dec 20, 2022
A BASIC language interpreter. Does not conform to existing standards. Mostly a toy.

JW-Basic A toy language that is somewhat like QBasic. Features: Graphics: 160x96 (255 colors & transparent) Text: 32x16 (4x5 font) Character set: ASCI

John Wells 8 Feb 15, 2023