88[ ![ license] ( https://img.shields.io/badge/license-wtfpl-ff1493?style=flat-square )] ( https://en.wikipedia.org/wiki/WTFPL )
99
1010This crate exports two simple compile-time ANSI formatting macros — ` csi ` and
11- ` ansi ` — as well as shortcut helpers for ` bold ` , ` dim ` , and ` underline ` .
11+ ` ansi ` — as well as shortcut helpers for ` blink ` , ` bold ` , ` dim ` ,
12+ ` italic ` , ` strike ` , and ` underline ` .
1213
1314## Examples
1415
@@ -25,20 +26,22 @@ assert_eq!(
2526);
2627```
2728
28- The ` dim ` , ` bold ` , and ` underline ` macros are only shortcuts, but can
29- help declutter your code when there's only the one style being toggled.
29+ The ` bold ` , ` dim ` , etc., macros are only shortcuts, but can help declutter
30+ your code when there's only the one style being toggled.
3031
3132``` rust
32- use fyi_ansi :: {bold, dim, underline};
33+ use fyi_ansi :: {blink, bold, dim, italic, strike , underline};
3334
3435// Same as with `ansi`, they terminate with a blanket reset by default.
35- assert_eq! (bold! (" I'm bold!" ), " \ x1b [1mI'm bold!\ x1b [0m" );
36- assert_eq! (dim! (" I'm dim!" ), " \ x1b [2mI'm dim!\ x1b [0m" );
37- assert_eq! (underline! (" I'm underlined!" ), " \ x1b [4mI'm underlined!\ x1b [0m" );
38-
39- // And same as `ansi`, the ">" modifier will make them terminate more
40- // selectively instead.
41- assert_eq! (bold! (> " I'm bold!" ), " \ x1b [1mI'm bold!\ x1b [21m" );
42- assert_eq! (dim! (> " I'm dim!" ), " \ x1b [2mI'm dim!\ x1b [22m" );
43- assert_eq! (underline! (> " I'm underlined!" ), " \ x1b [4mI'm underlined!\ x1b [24m" );
36+ assert_eq! (bold! (" I'm bold!" ), " \ x1b [1mI'm bold!\ x1b [0m" );
37+ assert_eq! (dim! (" I'm dim!" ), " \ x1b [2mI'm dim!\ x1b [0m" );
38+ assert_eq! (italic! (" I'm italic!" ), " \ x1b [3mI'm italic!\ x1b [0m" );
39+ assert_eq! (underline! (" I'm underlined!" ), " \ x1b [4mI'm underlined!\ x1b [0m" );
40+ assert_eq! (blink! (" I'm annoying!" ), " \ x1b [5mI'm annoying!\ x1b [0m" );
41+ assert_eq! (strike! (" I'm struck!" ), " \ x1b [9mI'm struck!\ x1b [0m" );
4442```
43+
44+ ## Stability
45+
46+ This library is currently under development and subject to breaking changes
47+ between dot releases, though the basic API is pretty well set.
0 commit comments