update docs
This commit is contained in:
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
||||
|
||||
## Project Overview
|
||||
|
||||
Clojure TUI framework inspired by Bubbletea (Go), using the Elm Architecture with Hiccup for views. Two runtimes: full async (`tui.core` with core.async) and simple sync (`tui.simple` for Babashka).
|
||||
Clojure TUI framework inspired by Bubbletea (Go), using the Elm Architecture with Hiccup for views. Works with both Babashka and full Clojure.
|
||||
|
||||
## Commands
|
||||
|
||||
@@ -15,7 +15,7 @@ bb test
|
||||
# List available examples
|
||||
bb examples
|
||||
|
||||
# Run examples (with Babashka - simple sync runtime)
|
||||
# Run examples with Babashka (recommended - fast startup)
|
||||
bb counter
|
||||
bb timer
|
||||
bb list
|
||||
@@ -23,7 +23,7 @@ bb spinner
|
||||
bb views
|
||||
bb http
|
||||
|
||||
# Run examples with full Clojure (async support)
|
||||
# Run examples with full Clojure
|
||||
clojure -A:dev -M -m examples.counter
|
||||
```
|
||||
|
||||
@@ -38,8 +38,7 @@ View (hiccup) → Render (ANSI string) → Terminal (raw mode I/O)
|
||||
|
||||
### Core Modules
|
||||
|
||||
- **tui.core** - Full async runtime with core.async. Manages the event loop, executes commands (quit, tick, batch, seq), handles input via goroutines.
|
||||
- **tui.simple** - Sync runtime for Babashka. Same API but no async commands.
|
||||
- **tui.core** - Main runtime with core.async. Manages the event loop, executes commands (quit, tick, batch, seq), handles input via goroutines.
|
||||
- **tui.render** - Converts hiccup (`[:col [:text "hi"]]`) to ANSI strings. Handles `:text`, `:row`, `:col`, `:box`, `:space` elements.
|
||||
- **tui.terminal** - Platform abstraction: raw mode via `stty`, reads from `/dev/tty`, renders by printing ANSI.
|
||||
- **tui.input** - Parses raw bytes into key messages (`[:key {:char \a}]`, `[:key :up]`, `[:key {:ctrl true :char \c}]`).
|
||||
@@ -47,7 +46,7 @@ View (hiccup) → Render (ANSI string) → Terminal (raw mode I/O)
|
||||
|
||||
### Elm Architecture Flow
|
||||
|
||||
1. App provides `:init` (model), `:update` (fn [model msg] -> [new-model cmd]), `:view` (fn [model] -> hiccup)
|
||||
1. App provides `:init` (model), `:update` (fn [model msg] -> [new-model cmd]), `:view` (fn [model size] -> hiccup)
|
||||
2. Runtime renders initial view
|
||||
3. Input loop reads keys, puts messages on channel
|
||||
4. Update function processes messages, may return commands
|
||||
|
||||
Reference in New Issue
Block a user