RepositoryRust
ratatui

ratatui/ansi-to-tui

Convert ansi colored text to tui::text::Text

102stars
31forks
4issues
0views

Thành tựu nổi bật

Những danh hiệu mới nhất của dự án

1
TINIX TRENDING·Chủ đề: ansi

#1 Repository Của Tháng

3
TINIX TRENDING·Chủ đề: tui-rs

#3 Repository Của Tháng

4
TINIX TRENDING·Chủ đề: ascii

#4 Repository Của Tháng

🎨 Chuyển đổi ANSI sang Ratatui Text trong Rust

Parse mã màu ANSI và tạo Text tương đương cho ứng dụng TUI bằng Ratatui.

Dự án ansi-to-tui là một crate Rust nhẹ cho phép chuyển đổi dữ liệu văn bản chứa mã màu ANSI (ví dụ: \x1b[31m) thành đối tượng [Text] của Ratatui, bảo toàn màu nền, màu chữ và định dạng (in đậm, in nghiêng...). Thiết kế để bỏ qua các mã lỗi thời hoặc không xác định, phù hợp với đầu ra thực tế từ terminal mà không cần xử lý sơ bộ.

✨ Điểm nổi bật

  • Hỗ trợ màu sắc đầy đủ: tên màu 8/16, màu Indexed 256 và Truecolor RGB.
  • Tích hợp Ratatui: xuất ra [Text] với [Color] và [Modifier] chính xác.
  • Bỏ qua mã lỗi: không làm gián đoạn khi gặp mã ANSI không hợp lệ.
  • Sử dụng đơn giản: gọi phương thức into_text() trên bất kỳ kiểu nào hỗ trợ AsRef<[u8]>.

💡 Vì sao đáng chú ý

Thay vì tự viết parser ANSI phức tạp, ansi-to-tui cung cấp giải pháp sẵn có, được kiểm thử và tích hợp sẵn với Ratatui. Dễ dàng nhúng vào các dự án TUI cần hiển thị log, output lệnh hoặc nội dung có màu sắc mà không mất công xử lý chuỗi mã màu.


#Rust #Ratatui #ANSI #TUI #TiniX

Similar Projects

Discover other similar projects and AI models.

RepositoryRust
farion1231/cc-switch

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

148.9k
Oct 26, 2026
Modelsentence-similarity
sentence-transformers/all-MiniLM-L6-v2

all-MiniLM-L6-v2 This is a sentence-transformers(https://www.SBERT.net) model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search. Usage (Sentence-Transformers) Using t...

♥0
190.2M
Jun 1, 2026
RepositoryShell
ohmyzsh/ohmyzsh

🙃 A delightful community-driven (with 2,500+ contributors) framework for managing your zsh configuration. Includes 300+ optional plugins (rails, git, macOS, hub, docker, homebrew, node, php, python, etc), 140+ themes to spice up your morning, and an auto-update tool that makes it easy to keep up with the latest updates from the community.

190.2k
Oct 25, 2026
RepositoryRust
alacritty/alacritty

A cross-platform, OpenGL terminal emulator.

66.0k
Oct 16, 2026
RepositoryRust
warpdotdev/warp

Warp is an agentic development environment, born out of the terminal.

65.7k
Oct 23, 2026
RepositoryRust
sharkdp/bat

A cat(1) clone with wings.

60.9k
Oct 20, 2026
RepositoryRust
sharkdp/fd

A simple, fast and user-friendly alternative to 'find'

44.9k
Oct 24, 2026
RepositoryRust
sxyazi/yazi

💥 Blazing fast terminal file manager written in Rust, based on async I/O.

43.0k
Oct 23, 2026
RepositoryRust
dominikwilkowski/cfonts

Sexy fonts for the console

1.9k
Oct 22, 2026