diff --git a/dev/containers/CCFormat/index.html b/dev/containers/CCFormat/index.html index bb758d24..64f10322 100644 --- a/dev/containers/CCFormat/index.html +++ b/dev/containers/CCFormat/index.html @@ -134,7 +134,13 @@ Format.printf f:( string -> 'b ) -> string -> ( 'a, t, unit, 'b ) Stdlib.format4 -> - 'a
with_color_ksf "Blue" ~f "%s %d" "yolo" 42 will behave like ksprintf, but wrapping the content with the given style.
Example: the following with raise Failure with a colored message
CCFormat.with_color_ksf "red" ~f:failwith "%a" CCFormat.Dump.(list int) [1;2;3];;module ANSI_codes : sig ... endANSI escape codes. This contains lower level functions for them.
val to_string : 'a printer -> 'a -> stringval of_chan : Stdlib.out_channel -> tAlias to Format.formatter_of_out_channel.
val with_out_chan : Stdlib.out_channel -> ( t -> 'a ) -> 'awith_out_chan oc f turns oc into a formatter fmt, and call f fmt. Behaves like f fmt from then on, but whether the call to f fails or returns, fmt is flushed before the call terminates.
val stdout : tval stderr : tval sprintf : ( 'a, t, unit, string ) Stdlib.format4 -> 'aPrint into a string any format string that would usually be compatible with fprintf. Like Format.asprintf.
val sprintf_no_color : ( 'a, t, unit, string ) Stdlib.format4 -> 'aLike sprintf but never prints colors.
with_color_ksf "Blue" ~f "%s %d" "yolo" 42 will behave like ksprintf, but wrapping the content with the given style.
Example: the following with raise Failure with a colored message
CCFormat.with_color_ksf "red" ~f:failwith "%a" CCFormat.Dump.(list int) [1;2;3];;module ANSI_codes : sig ... endANSI escape codes. This contains lower level functions for them.
val styling : ANSI_codes.style list -> 'a printer -> 'a printerstyling st p is the same printer as p, except it locally sets the style st.
Example:
open CCFormat;
+set_color_default true;
+sprintf
+ "what is your %a? %a! No, %a! Ahhhhhhh@."
+ (styling [`FG `White; `Bold] string) "favorite color"
+ (styling [`FG `Blue] string) "blue"
+ (styling [`FG `Red] string) "red"Available only on OCaml >= 4.08.
val with_styling : ANSI_codes.style list -> t -> ( unit -> 'a ) -> 'awith_styling style fmt f sets the given style on fmt, calls f(), then restores the previous style. It is useful in imperative-style printers (a sequence of "print a; print b; …").
Available only on OCaml >= 4.08.
val to_string : 'a printer -> 'a -> stringval of_chan : Stdlib.out_channel -> tAlias to Format.formatter_of_out_channel.
val with_out_chan : Stdlib.out_channel -> ( t -> 'a ) -> 'awith_out_chan oc f turns oc into a formatter fmt, and call f fmt. Behaves like f fmt from then on, but whether the call to f fails or returns, fmt is flushed before the call terminates.
val stdout : tval stderr : tval sprintf : ( 'a, t, unit, string ) Stdlib.format4 -> 'aPrint into a string any format string that would usually be compatible with fprintf. Like Format.asprintf.