Expand description
§tabulator
This is grid-style tabulation for Rust, for left/right/centre justification of strings and decimal point alignment.
The motivation to build such a thing is Beancount Lima.
§Example Output
§Simple case with manual anchoring
A 1.25 A99
B1 12.2 B§Using rust_decimal auto-anchor
Assets:Bank:Current 350.75 NZD Howzah!
Assets:Bank:Investment 2.25 NZD Skint§Features
There are no default features.
Optional features are:
rust_decimal- adds a dependency on that crate andFrom::<Decimal>forCellnum-bigint- adds a dependency on that crate andFrom::<BigInt>andFrom::<BigUint>forCell
§License
Licensed under either of
- Apache License, Version 2.0 LICENSE-APACHE
- MIT license LICENSE-MIT
at your option.
§Simple example
Generates the output as shown above.
fn main() {
use Align::*;
use Cell::*;
let cell = Column(vec![
Row(vec![("A", Left).into(), Cell::anchored("1.25", 1), ("A99", Right).into()], Gap::Medium),
Row(vec![("B1", Left).into(), Cell::anchored("12.2", 2), ("B", Right).into()], Gap::Medium),
]);
let output = cell.to_string();
}