1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
//! # rich-ext
//!
//! Extensions layered on top of the faithful [`rich`] core, plus the internal
//! plugin registry. **Anything that is not a faithful port of upstream `rich`
//! belongs here**, so the core stays a clean, easily-synced mirror.
//!
//! This crate carries its own independent SemVer (it does not track any upstream
//! version). See `AGENTS.md` → Versioning and `docs/PLUGINS.md`.
//!
//! ## Modules
//!
//! - Errors and logs: [`diagnostic`], [`dashboard`], [`stacktrace`],
//! [`hyperlink`], [`log_handler`] (`RichHandler`, `SpanView`), [`adapters`]
//! (`EventSink`; `LogAdapter` and `EventLayer` with the `log` / `tracing`
//! features), [`event`], [`log_stream`] (log records parsed, filtered,
//! collapsed and grouped, and [`ChannelSink`](log_stream::ChannelSink)).
//! - Data and authoring: `data`, `deps` (Cargo dependency trees) and `schema`
//! (JSON Schema trees and diffs, and the format-neutral schema model), all
//! behind the `data` feature;
//! [`derive`](mod@derive), [`macros`] (the
//! `macros` feature re-exports `richf!` and `#[derive(Rich)]`),
//! [`inspect`](mod@inspect) (`rich.inspect` from `#[derive(Inspect)]`), [`cli_doc`]
//! (`clap` feature for `clap::Command`).
//! - Diffs and testing: [`diff`], `testing` and `qa` (`testing` feature).
//! - Terminals: [`capabilities`], [`fidelity`], [`a11y`], [`target`],
//! [`ansi_explain`], [`sanitize`], [`encoding`], [`clipboard`] (OSC 52).
//! - Workflows: [`workflow`], [`transfer`], [`countdown`], [`notify`],
//! [`cancel`], [`table`], [`badge`], [`size_bar`], [`format`](mod@format), [`redact`]
//! (experimental).
//! - Charts: [`chart`] (sparklines, bars, histograms, line and scatter plots,
//! gauges, heatmaps, status matrices, KPI cards and timelines; ratatui's
//! chart, canvas with a world map, and gauges).
//! - Colour: [`palette`] (Tailwind's and Material's palettes; HSL, HSV,
//! Okhsv and Oklab colours, blends and gradients).
//! - Inspectors: [`source_view`], [`hex`], [`unicode_inspect`],
//! [`env_inspect`].
//! - Documents: `document` (Org, AsciiDoc and man pages beside Markdown and
//! `rst`, with format detection; `syntax` feature).
//! - Layout and live output: [`layout`], [`live`], [`surface`] (positioned
//! drawing that writes only what changed).
//! - Pipelines: [`transform`], and `data::transform` (`jsonpath` feature).
//! - Files: [`filetype`] (icons, colours, MIME types), [`fs`] (local times,
//! owners), [`listing`] (entries, sorting, a tree walk), [`open`] (opener
//! rules), [`file_ops`] (copy, move, delete with progress), [`trash`] (the
//! FreeDesktop trash), [`git`] (status per file), and `archive` (tar and zip
//! listing and extraction; `archive` feature).
//!
//! The user guide (<https://buchochelliq-labs.github.io/rs-rich-cli/guide/ext/>)
//! covers each module with compiled examples.
//!
//! ```
//! use rich::{Console, ColorSystem};
//! use rich_ext::ConsoleExt;
//!
//! let mut console = Console::builder()
//! .force_terminal(true)
//! .color_system(Some(ColorSystem::Truecolor))
//! .build();
//! console.install_extensions(); // registers the number highlighter, etc.
//! let out = console.render_str_to_string("count=7");
//! assert!(out.contains("\x1b[1;36m7\x1b[0m"));
//! ```
// A builder method that returns `Self` is `#[must_use]`: dropping its
// result drops the value (CONTRIBUTING.md, "API conventions").
// Tar, tar.gz and zip listings and extraction.
// Documentation formats (Markdown, reStructuredText, Org, AsciiDoc, man).
// FFT, Hann window and spectrum.
// File-type icons, MIME types and the Nerd Font check.
// Text coloured along a gradient of two or more colours.
// Local times and owner names for file listings.
// File operations with progress: copy, move, delete, trash.
// Git's status of each file, through `git status --porcelain`.
// Directory entries, sorting, line-mode cells and a lazy tree walk.
// Which program opens a file: Yazi's opener rules.
// QR codes drawn with half blocks.
// A pure-Rust SQL highlighter (no syntect), with Jinja blocks for dbt.
// Warming up syntax highlighting on a worker thread.
// The FreeDesktop trash: put, list, restore, purge.
pub use NumberHighlighter;
pub use ;
/// The plugin contract, re-exported so a host needs only `rich_ext`.
pub use rich_plugin_api as plugin;
pub use sanitize_terminal_controls;
pub use ;
use Console;
/// Ergonomic extension methods on the core [`Console`].
///
/// Defined here (not in core) so the core remains free of our additions.
// QA tooling: screenshots, stress, lint, explain, profile, fuzz, matrix, bench.
pub use ;
// `rich.inspect` from compile-time data (#796): the report is always here;
// `#[derive(Inspect)]` and `#[inspect]` on impl blocks need `macros`.
pub use ;
pub use ;
/// Paths the macros expand to. Not a public API.
pub use ;
// Log streams: parsing, filtering, collapsing and grouping records (#724).
// `EventSink` always; `LogAdapter` and `EventLayer` behind `log` and `tracing`.
// Real sources drawn as trees: Cargo dependency graphs and JSON Schemas.
// CLI authoring: help, errors, completions, docs, config reference and
// precedence from one command description.
// Diffs: engine, views, source/patch renderers, test reports and assertions.
// Transfers, retry/rate-limit countdowns and transient notifications.