diff --git a/fmt/Fmt/index.html b/fmt/Fmt/index.html index a4abb7e2..a3ecd229 100644 --- a/fmt/Fmt/index.html +++ b/fmt/Fmt/index.html @@ -37,7 +37,14 @@ ?post:unit t -> kind:string -> 'a t -> - ('a * 'a list) t

did_you_mean ~pre kind ~post pp_v formats a faulty value v of kind kind and a list of hints that v could have been mistaken for.

pre defaults to unit "Unknown", post to nop they surround the faulty value before the "did you mean" part as follows "%a %s %a%a." pre () kind pp_v v post (). If hints is empty no "did you mean" part is printed.

Conditional UTF-8 formatting

Note. Since Format is not UTF-8 aware using UTF-8 output may derail the pretty printing process. Use the pretty-printers from Uuseg_string if you are serious about UTF-8 formatting.

val if_utf_8 : 'a t -> 'a t -> 'a t

if_utf_8 pp_u pp ppf v is:

val utf_8 : Stdlib.Format.formatter -> bool

utf_8 ppf is true if UTF-8 output is enabled on ppf. If set_utf_8 hasn't been called on ppf this is true.

val set_utf_8 : Stdlib.Format.formatter -> bool -> unit

set_utf_8 ppf b enables or disables conditional UTF-8 formatting on ppf.

Styled formatting

type color = [
  1. | `Black
  2. | `Blue
  3. | `Cyan
  4. | `Green
  5. | `Magenta
  6. | `Red
  7. | `White
  8. | `Yellow
]

The type for colors.

type style = [
  1. | `None
  2. | `Bold
  3. | `Faint
  4. | `Italic
  5. | `Underline
  6. | `Reverse
  7. | `Fg of [ color | `Hi of color ]
  8. | `Bg of [ color | `Hi of color ]
  9. | color
]

The type for styles:

val styled : style -> 'a t -> 'a t

styled s pp formats like pp but styled with s.

Style rendering control

type style_renderer = [
  1. | `Ansi_tty
  2. | `None
]

The type for style renderers.

val style_renderer : Stdlib.Format.formatter -> style_renderer

style_renderer ppf is the style renderer used by ppf. If set_style_renderer has never been called on ppf this is `None.

val set_style_renderer : Stdlib.Format.formatter -> style_renderer -> unit

set_style_renderer ppf r sets the style renderer of ppf to r.

Converting with string value converters

val of_to_string : ('a -> string) -> 'a t

of_to_string f ppf v is string ppf (f v).

val to_to_string : 'a t -> 'a -> string

to_to_string pp_v v is strf "%a" pp_v v.

Deprecated

val strf : ('a, Stdlib.Format.formatter, unit, string) format4 -> 'a
val kstrf : + ('a * 'a list) t

did_you_mean ~pre kind ~post pp_v formats a faulty value v of kind kind and a list of hints that v could have been mistaken for.

pre defaults to unit "Unknown", post to nop they surround the faulty value before the "did you mean" part as follows "%a %s %a%a." pre () kind pp_v v post (). If hints is empty no "did you mean" part is printed.

val cardinal : ?zero:int t -> one:int t -> ?other:int t -> unit -> int t

cardinal ?zero ~one ?other () formats an integer by selecting a formatter according to the cardinal english plural form of its absolute value n:

val ordinal : + ?zero:int t -> + ?one:int t -> + ?two:int t -> + ?three:int t -> + ?other:int t -> + unit -> + int t

ordinal ?zero ?one ?two ?three ?other () formats an integer by selecting a formatter according to the ordinal english plural form of its absolute value n:

Conditional UTF-8 formatting

Note. Since Format is not UTF-8 aware using UTF-8 output may derail the pretty printing process. Use the pretty-printers from Uuseg_string if you are serious about UTF-8 formatting.

val if_utf_8 : 'a t -> 'a t -> 'a t

if_utf_8 pp_u pp ppf v is:

val utf_8 : Stdlib.Format.formatter -> bool

utf_8 ppf is true if UTF-8 output is enabled on ppf. If set_utf_8 hasn't been called on ppf this is true.

val set_utf_8 : Stdlib.Format.formatter -> bool -> unit

set_utf_8 ppf b enables or disables conditional UTF-8 formatting on ppf.

Styled formatting

type color = [
  1. | `Black
  2. | `Blue
  3. | `Cyan
  4. | `Green
  5. | `Magenta
  6. | `Red
  7. | `White
  8. | `Yellow
]

The type for colors.

type style = [
  1. | `None
  2. | `Bold
  3. | `Faint
  4. | `Italic
  5. | `Underline
  6. | `Reverse
  7. | `Fg of [ color | `Hi of color ]
  8. | `Bg of [ color | `Hi of color ]
  9. | color
]

The type for styles:

val styled : style -> 'a t -> 'a t

styled s pp formats like pp but styled with s.

Style rendering control

type style_renderer = [
  1. | `Ansi_tty
  2. | `None
]

The type for style renderers.

val style_renderer : Stdlib.Format.formatter -> style_renderer

style_renderer ppf is the style renderer used by ppf. If set_style_renderer has never been called on ppf this is `None.

val set_style_renderer : Stdlib.Format.formatter -> style_renderer -> unit

set_style_renderer ppf r sets the style renderer of ppf to r.

Converting with string value converters

val of_to_string : ('a -> string) -> 'a t

of_to_string f ppf v is string ppf (f v).

val to_to_string : 'a t -> 'a -> string

to_to_string pp_v v is strf "%a" pp_v v.

Deprecated

val strf : ('a, Stdlib.Format.formatter, unit, string) format4 -> 'a
val kstrf : (string -> 'a) -> ('b, Stdlib.Format.formatter, unit, 'a) format4 -> 'b
val strf_like : diff --git a/fmt/Fmt_top/index.html b/fmt/Fmt_top/index.html new file mode 100644 index 00000000..8da1cdbe --- /dev/null +++ b/fmt/Fmt_top/index.html @@ -0,0 +1,2 @@ + +Fmt_top (fmt.Fmt_top)

Module Fmt_top

This module is hidden.

diff --git a/fmt/_doc-dir/CHANGES.md b/fmt/_doc-dir/CHANGES.md index 8306484f..1d854d91 100644 --- a/fmt/_doc-dir/CHANGES.md +++ b/fmt/_doc-dir/CHANGES.md @@ -1,3 +1,10 @@ +v0.11.0 2025-07-25 Zagreb +------------------------- + +* Add `Fmt.{cardinal,ordinal}` to format english + plurals. Thanks to Brian Ward for suggesting (#64). +* Export `fmt` from `fmt.tty` and `fmt.cli` libraries. + v0.10.0 2025-03-10 La Forclaz (VS) ---------------------------------- diff --git a/fmt/_doc-dir/odoc-pages/index.mld b/fmt/_doc-dir/odoc-pages/index.mld index 25f46e42..2ece0194 100644 --- a/fmt/_doc-dir/odoc-pages/index.mld +++ b/fmt/_doc-dir/odoc-pages/index.mld @@ -1,4 +1,4 @@ -{0 Fmt {%html: v0.10.0%}} +{0 Fmt {%html: v0.11.0%}} Fmt exposes combinators to devise {!Format} pretty-printing functions. diff --git a/logs/Logs_top/index.html b/logs/Logs_top/index.html new file mode 100644 index 00000000..b94fe2f4 --- /dev/null +++ b/logs/Logs_top/index.html @@ -0,0 +1,2 @@ + +Logs_top (logs.Logs_top)

Module Logs_top

This module is hidden.

diff --git a/mtime/Mtime_top/index.html b/mtime/Mtime_top/index.html new file mode 100644 index 00000000..62bc8459 --- /dev/null +++ b/mtime/Mtime_top/index.html @@ -0,0 +1,2 @@ + +Mtime_top (mtime.Mtime_top)

Module Mtime_top

This module is hidden.

diff --git a/ptime/Ptime_top/index.html b/ptime/Ptime_top/index.html new file mode 100644 index 00000000..db4a6fb6 --- /dev/null +++ b/ptime/Ptime_top/index.html @@ -0,0 +1,2 @@ + +Ptime_top (ptime.Ptime_top)

Module Ptime_top

This module is hidden.