Skip to content
프로젝트

소개

TUI library in Rust with a custom templating language and runtime

개발 도구

이 수치를 측정하는 방법

What you can do

  • Reactive templates
  • Template functions
  • Third party components
  • Distributable templates

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
-1
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Anathema

The Guide

Crates.io Docs.rs

Anathema is a library for building text user interfaces using composable components, with a custom markup language.

It was created with the intent to give developers a fast and easy way to build text user interfaces (TUIs) and ship the template(s) alongside the application, giving the end user the option to customise the application to their liking.

By separating the layout from the rest of the application, reducing the amount of code needed to express your design, and featuring hot reloading it becomes incredibly fast to iterate over the design.

Anathema has a single pass layout inspired by Flutter and Swift UI.

Supported features

  • Hot reloading
  • Reactive templates
  • Template functions
  • Third party components
  • Distributable templates
  • Message passing supports async
  • Message passing between components via an emitter

Note Anathema should be considered beta for now.

See The Guide for getting started.

Example component

struct MyComponent;

impl Component for MyComponent {
    type State = MyState;
    type Message = ();

    fn on_tick(
        &mut self,
        state: &mut Self::State,
        children: Children<'_, '_>,
        context: Context<'_, '_, Self::State>,
        dt: Duration,
    ) {
        *state.value.to_mut() += 1;
    }
}

#[derive(State)]
struct MyState {
    counter: Value<u32>,
}

Example template

vstack
    text "the counter is " state.counter
    text "the counter will be " state.counter + 1
    if state.count > 10
        text "the counter is more than ten"

output

the counter is 11
the counter will be 12
the counter is more than ten

Screenshots etc.

Bubbles by Jyn ASCII

cinema

Markdown reader by Doddi

Markdown reader by Doddi

Screenshot by Jyn

Bunny rpg by Jyn

Twitch UI by Twitch user s9tpepper_

Twitch ui by Twitch user s9tpepper_

관련 프로젝트 살펴보기

불러오는 중…