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
//! Micro assets for rs-rich (#565): emoji-sized inline images and
//! animations, written `Deploying :micro:rocket:`.
//!
//! Not a port of anything upstream: an rs-rich addition, outside core. Core
//! is unchanged: `:micro:name:` is not an emoji code, so it passes through
//! core untouched, and every seam here goes through core's public API (style
//! metadata, [`Renderable`](rich::Renderable)) or rs-rich-ext's.
//!
//! - [`MicroAsset`]: a name, a kind, a size in cells (2×1 by default, up
//! to 4×2: 1 to 4 columns, 1 or 2 rows), images, mandatory alt text, an
//! emoji or text fallback, and where it came from.
//! - [`package`]: `.richmicro` packages and packs, read under hard
//! [`Limits`].
//! - [`MicroRegistry`]: built-in < user < trusted project < inline, with
//! aliases, collisions and [`explain`](MicroRegistry::explain).
//! - [`markup`]: `:micro:name:` in markup and text, and in Markdown
//! ([`PreparedMarkdown`]); [`MicroExt`] and [`MicroAssetRef`] in code.
//! - [`render`]: the placeholder representation, and the [`MicroRenderer`]
//! seam that terminal graphics plug into.
//! - [`rows`]: assets two rows high (a 2×2 icon, a 3×2 animation):
//! [`MicroRows`] reserves the row below the line each one sits on, in
//! wrapped text, table cells and panels.
//! - [`graphics`]: drawing on a terminal: [`select`] picks Kitty, iTerm2,
//! Sixel, half-blocks or the text fallback, and [`MicroGraphics`] draws
//! with it, in printed output and through the graphics side channel of
//! `rich-ext`'s live regions and the interactive painter.
//! - [`cache`]: decoded images fitted to their cells, cached in memory and
//! on disk.
//! - [`pipeline`]: any picture or animation to an asset's images: fitted,
//! adjusted, sharpened, with its transparency decided; [`create`] writes
//! the package.
//! - [`builtin`]: the built-in library (status, dev and fun sets), drawn for
//! this project; [`MicroRegistry::builtin`] loads it.
//!
//! ```
//! use rich::Console;
//! use rich_micro::{render_markup, FallbackPreference, Layer, MicroAsset, MicroRegistry};
//!
//! let mut registry = MicroRegistry::new();
//! registry.add(Layer::Inline, MicroAsset::new("ship", "rocket")?.with_emoji("🚀")?)?;
//! let console = Console::builder().width(40).build();
//! let (text, diagnostics) =
//! render_markup(&console, "Deploying :micro:ship: :fire:", ®istry, FallbackPreference::Emoji);
//! assert_eq!(text.plain(), "Deploying 🚀 🔥");
//! assert!(diagnostics.is_empty());
//! # Ok::<(), rich_micro::MicroError>(())
//! ```
// A builder method that returns `Self` is `#[must_use]`: dropping its
// result drops the value (CONTRIBUTING.md, "API conventions").
pub use ;
pub use ;
pub use MicroError;
pub use ;
pub use ;
pub use ;
pub use is_valid_name;
pub use ;
pub use ;
pub use ;
/// The size of a terminal cell in pixels, as the cache and pipeline take it.
pub use CellPixels;
pub use ;