pub enum Modifier {
Truncate(usize),
Upper,
Lower,
Title,
IconMap(HashMap<String, String>),
Prefix(String),
Suffix(String),
Basename,
Dirname,
Extension,
Stem,
Parent(usize),
}Expand description
Format modifiers that transform variable values.
Variants§
Truncate(usize)
Truncate to N characters with ellipsis.
Upper
Convert to uppercase.
Lower
Convert to lowercase.
Title
Convert to title case (capitalize first letter of each word).
IconMap(HashMap<String, String>)
Map values to icons using a lookup table.
Example: {status|icon:ok=✓,warn=⚠,fail=✗}
Prefix(String)
Add a prefix to the value.
Suffix(String)
Add a suffix to the value.
Basename
Get the final component of a path (file or directory name).
Example: /home/user/project → project
Dirname
Get the parent directory path.
Example: /home/user/project → /home/user
Extension
Get the file extension without the leading dot.
Example: main.rs → rs
Stem
Get the file name without the extension.
Example: main.rs → main
Parent(usize)
Get an ancestor directory at a specific depth.
Depth 1 = parent, depth 2 = grandparent, etc.
Returns the basename of the ancestor.
Example: /home/user/project/src with depth 2 → user