Skip to content

Commit 95579fd

Browse files
committed
docs: updated README
1 parent ac08610 commit 95579fd

1 file changed

Lines changed: 63 additions & 7 deletions

File tree

README.md

Lines changed: 63 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,53 @@
11

22
# Twinkle
33

4-
Twinkle is a Java utility library for creating text-based user interfaces.
4+
Twinkle is a Java framework for creating text-based user interfaces (TUIs) in terminal emulators. It provides a layered architecture with components for text manipulation, screen rendering, shapes/borders, and terminal abstraction.
55

6-
This is a very early proof of concept, nothing to see here (yet)
6+
## Architecture
77

8-
## Components
8+
The project follows a layered architecture:
99

10-
- `twinkle-ansi` - A library for working with ANSI escape codes, providing utilities for styling and formatting text in the terminal.
11-
- `twinkle-text` - A library for managing, manipulating and rendering text.
10+
- **Foundation**: Text utilities and ANSI escape code support
11+
- **Rendering**: Screen buffers and double-buffering for flicker-free rendering
12+
- **UI Components**: Drawing utilities for borders and shapes
13+
- **Terminal Access**: Abstraction layer with pluggable implementations
14+
15+
## Modules
16+
17+
### Core Modules
18+
19+
- **`twinkle-text`** - Core text handling and utilities for terminal applications
20+
- Position, Size, and dimension management
21+
- Unicode character utilities
22+
- Text sequence processing
23+
- ANSI escape codes (colors, styles, hyperlinks, mouse events)
24+
- Fluent API for building styled text with markup parsing
25+
26+
- **`twinkle-screen`** - Screen and buffer management for rendering content
27+
- `Buffer` - 2D renderable buffer with styled text and colors
28+
- `SwappableBuffer` - Double-buffering for flicker-free rendering
29+
- `BufferStack` - Stack-based buffer management for layering
30+
- Buffer I/O utilities
31+
32+
- **`twinkle-shapes`** - ASCII-based drawing utilities and UI components
33+
- Border drawing with various styles (ASCII, single-line, rounded)
34+
- Line and corner styles
35+
- Drawing utilities
36+
37+
### Terminal Implementations
38+
39+
- **`twinkle-terminal`** - Terminal access and management abstraction API
40+
- `Terminal` interface for terminal operations
41+
- Service provider interface for different implementations
42+
- Support for terminal sizing and resize callbacks
43+
44+
- **`twinkle-terminal-aesh`** - Terminal implementation using the Aesh library
45+
- **`twinkle-terminal-jline`** - Terminal implementation using the JLine 3 library
46+
47+
### Examples
48+
49+
- **`examples`** - Example programs demonstrating Twinkle capabilities
50+
- `BouncingTwinkleDemo` - Animated demo with bouncing text and ASCII borders
1251

1352
## Building
1453

@@ -18,6 +57,23 @@ To build the project, run the following command:
1857
./mvnw clean package
1958
```
2059

21-
## Running
60+
## Running Examples
61+
62+
After building, you can run the example programs to see Twinkle in action. This is most easily done using [JBang](jbang.dev):
63+
64+
```bash
65+
# Bouncing animation demo
66+
jbang bounce
67+
```
68+
69+
Or if you want to use regular Java commands:
70+
71+
```bash
72+
# Bouncing animation demo
73+
java -jar examples/target/examples-1.0-SNAPSHOT.jar org.codejive.twinkle.examples.BouncingTwinkleDemo
74+
```
75+
76+
## Requirements
2277

23-
Nothing to see here yet...
78+
- Java 8 or higher (tests require Java 21)
79+
- A terminal emulator with ANSI support

0 commit comments

Comments
 (0)