Skip to main content

ftui_extras/
lib.rs

1//! Optional feature-gated extensions for FrankenTUI.
2//!
3//! Each module is behind a Cargo feature flag and can be enabled independently.
4//! These modules provide higher-level functionality built on top of the core
5//! ftui crates (render, style, text, widgets).
6//!
7//! # Role in FrankenTUI
8//! `ftui-extras` collects optional, higher-level utilities that are useful
9//! across apps but not required by the core runtime or render kernel. It is
10//! feature-gated to keep the base dependency graph lean.
11//!
12//! # How it fits in the system
13//! Extras build on `ftui-render`, `ftui-style`, `ftui-text`, and `ftui-widgets`.
14//! You can enable only the pieces you need without pulling in everything else.
15//!
16//! # Available Features
17//!
18//! | Feature | Module | Description |
19//! |---------|--------|-------------|
20//! | `canvas` | [`canvas`] | Pixel-level drawing primitives |
21//! | `charts` | [`charts`] | Chart widgets (depends on canvas) |
22//! | `clipboard` | [`clipboard`] | OSC 52 clipboard integration |
23//! | `diagram` | [`diagram`] | ASCII diagram detection and correction |
24//! | `console` | [`console`] | ANSI-aware console text processing |
25//! | `export` | [`export`] | Buffer export to HTML/SVG/text |
26//! | `filesize` | [`filesize`] | Human-readable file size formatting |
27//! | `filepicker` | [`filepicker`] | File picker state utilities |
28//! | `forms` | [`forms`] | Form layout and input widgets |
29//! | `validation` | [`validation`] | Form validation framework with composable validators |
30//! | `image` | [`image`] | Terminal image protocols (iTerm2/Kitty) |
31//! | `live` | [`live`] | Live-updating display (depends on console) |
32//! | `logging` | [`logging`] | Tracing subscriber for TUI logging |
33//! | `markdown` | [`markdown`] | Markdown to styled text rendering |
34//! | `pty-capture` | [`pty_capture`] | PTY session capture |
35//! | `stopwatch` | [`stopwatch`] | Stopwatch timing utility |
36//! | `syntax` | [`syntax`] | Syntax highlighting spans |
37//! | `timer` | [`timer`] | Countdown timer utility |
38//! | `traceback` | [`traceback`] | Error/stacktrace display |
39//! | `theme` | [`theme`] | Color themes + palette tokens |
40//! | `terminal` | [`terminal`] | ANSI escape sequence parser for terminal emulation |
41//! | `text-effects` | [`text_effects`] | Animated text effects (gradients, fades, ASCII art) |
42//! | `visual-fx` | [`visual_fx`] | Feature-gated visual FX primitives (backdrops, CPU/GPU adapters) |
43//! | `fx-gpu` | `visual_fx::gpu` | Optional GPU acceleration for metaballs (silent CPU fallback) |
44//! | `help` | [`help`] | Contextual help system with tooltips |
45
46#![forbid(unsafe_code)]
47
48#[cfg(test)]
49use stats_alloc::{INSTRUMENTED_SYSTEM, StatsAlloc};
50#[cfg(test)]
51use std::alloc::System;
52
53#[cfg(test)]
54#[global_allocator]
55static GLOBAL: &StatsAlloc<System> = &INSTRUMENTED_SYSTEM;
56
57#[cfg(feature = "canvas")]
58pub mod canvas;
59
60#[cfg(feature = "console")]
61pub mod console;
62
63#[cfg(feature = "charts")]
64pub mod charts;
65
66#[cfg(feature = "clipboard")]
67pub mod clipboard;
68
69#[cfg(feature = "diagram")]
70pub mod diagram;
71
72#[cfg(feature = "diagram")]
73pub mod mermaid;
74
75#[cfg(feature = "diagram")]
76pub mod mermaid_layout;
77
78#[cfg(feature = "diagram")]
79pub mod diagram_layout;
80
81#[cfg(feature = "diagram")]
82pub mod mermaid_render;
83
84#[cfg(all(feature = "diagram", feature = "canvas"))]
85pub mod mermaid_minimap;
86
87#[cfg(feature = "diagram")]
88pub mod mermaid_diff;
89
90#[cfg(feature = "diagram")]
91pub mod dot_parser;
92#[cfg(feature = "export")]
93pub mod export;
94
95#[cfg(feature = "filesize")]
96pub mod filesize;
97
98#[cfg(feature = "forms")]
99pub mod forms;
100
101#[cfg(feature = "validation")]
102pub mod validation;
103
104#[cfg(feature = "image")]
105pub mod image;
106
107#[cfg(feature = "live")]
108pub mod live;
109
110#[cfg(feature = "logging")]
111pub mod logging;
112
113#[cfg(feature = "markdown")]
114pub mod markdown;
115
116#[cfg(feature = "pty-capture")]
117pub mod pty_capture;
118
119#[cfg(feature = "syntax")]
120pub mod syntax;
121
122#[cfg(feature = "filepicker")]
123pub mod filepicker;
124
125#[cfg(feature = "traceback")]
126pub mod traceback;
127
128#[cfg(feature = "stopwatch")]
129pub mod stopwatch;
130
131#[cfg(feature = "timer")]
132pub mod timer;
133
134#[cfg(feature = "theme")]
135pub mod theme;
136
137#[cfg(feature = "terminal")]
138pub mod terminal;
139
140#[cfg(feature = "text-effects")]
141pub mod glowing_text;
142
143#[cfg(feature = "text-effects")]
144pub mod text_effects;
145
146#[cfg(feature = "visual-fx")]
147pub mod visual_fx;
148
149#[cfg(feature = "help")]
150pub mod help;
151
152#[cfg(feature = "doom")]
153pub mod doom;
154
155#[cfg(feature = "quake")]
156pub mod quake;