doing_template/lib.rs
1//! Template parsing and rendering for the doing CLI.
2//!
3//! Templates are format strings that control how entries are displayed. They
4//! use `%`-prefixed tokens for placeholders and colors:
5//!
6//! ```text
7//! %boldwhite%title%reset %interval %cyan[%section]%reset
8//! ```
9//!
10//! # Placeholders
11//!
12//! `%title`, `%date`, `%shortdate`, `%section`, `%interval`, `%duration`,
13//! `%note`, `%tags`, and more. Placeholders support optional width and
14//! indentation modifiers (e.g. `%-10shortdate`, `%_2note`).
15//!
16//! # Colors
17//!
18//! Named ANSI colors (`%red`, `%boldcyan`, `%reset`), background variants
19//! (`%bg_blue`), and hex colors (`%#ff8800`, `%bg#003366`).
20//!
21//! # Modules
22//!
23//! - [`colors`] — ANSI color name resolution and style application.
24//! - [`parser`] — tokenizer that splits a template string into color spans
25//! and placeholders.
26//! - [`renderer`] — applies parsed templates to entries, producing styled output.
27//! - [`totals`] — per-tag duration totals appended to rendered output.
28//! - [`wrap`] — word wrapping that respects ANSI escapes and tag values.
29
30pub mod colors;
31pub mod parser;
32pub mod renderer;
33pub mod totals;
34pub mod wrap;