From b492e0e0df5a264b68159a214140591a7a8dec90 Mon Sep 17 00:00:00 2001 From: c-cube Date: Mon, 25 Aug 2025 14:16:55 +0000 Subject: [PATCH] deploy: 5facbdfc6d1638d0c417f495f26e4862032f321f --- fmt/Fmt/index.html | 9 ++++++++- fmt/Fmt_top/index.html | 2 ++ fmt/_doc-dir/CHANGES.md | 7 +++++++ fmt/_doc-dir/odoc-pages/index.mld | 2 +- logs/Logs_top/index.html | 2 ++ mtime/Mtime_top/index.html | 2 ++ ptime/Ptime_top/index.html | 2 ++ 7 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 fmt/Fmt_top/index.html create mode 100644 logs/Logs_top/index.html create mode 100644 mtime/Mtime_top/index.html create mode 100644 ptime/Ptime_top/index.html 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:

  • pp_u ppf v if utf_8 ppf is true.
  • pp ppf v otherwise.
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.

  • raises Invalid_argument

    if ppf is Format.str_formatter: it is is always UTF-8 enabled.

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:

  • `None resets the styling.
  • `Bold, `Faint, `Italic, `Underline and `Reverse are display attributes.
  • `Fg _ is the foreground color or high-intensity color on `Hi _.
  • `Bg _ is the background color or high-intensity color on `Hi _.
  • #color is the foreground color, deprecated use `Fg #color instead.
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.

  • raises Invalid_argument

    if ppf is Format.str_formatter: its renderer is always `None.

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
  • deprecated

    use str instead.

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:

  • zero, if n = 0. Defaults to other (as per english rules).
  • one, if n = 1.
  • other, otherwise. Defaults to one followed by a 's' character.
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:

  • zero, if n = 0. Defaults to other (as per english rules).
  • one, if n mod 10 = 1 && n mod 100 <> 11. Defaults to "%dst".
  • two, if n mod 10 = 2 && n mod 100 <> 12. Defaults to "%dnd".
  • three, if n mod 10 = 3 && n mod 100 <> 13. Defaults to "%drd".
  • other otherwise. Defaults to "%dth".

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:

  • pp_u ppf v if utf_8 ppf is true.
  • pp ppf v otherwise.
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.

  • raises Invalid_argument

    if ppf is Format.str_formatter: it is is always UTF-8 enabled.

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:

  • `None resets the styling.
  • `Bold, `Faint, `Italic, `Underline and `Reverse are display attributes.
  • `Fg _ is the foreground color or high-intensity color on `Hi _.
  • `Bg _ is the background color or high-intensity color on `Hi _.
  • #color is the foreground color, deprecated use `Fg #color instead.
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.

  • raises Invalid_argument

    if ppf is Format.str_formatter: its renderer is always `None.

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
  • deprecated

    use str instead.

val kstrf : (string -> 'a) -> ('b, Stdlib.Format.formatter, unit, 'a) format4 -> 'b
  • deprecated

    use kstr instead.

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.