package pplumbing

  1. Overview
  2. Docs
Utility libraries to use with [pp]

Install

Dune Dependency

Authors

Maintainers

Sources

pplumbing-0.0.14.tbz
sha256=ed7eaba180378a59719e9af63ccdc89dde8e0a20f2cba420abb0080b0bc4a868
sha512=f168c37c1acd38c92e5b6d59321da4021195b6ddc49dde82de70e9282b55042621bea1b84a677d57f83604c06d6ee9c790b683fd589cd2097ab8f00c293f56af

doc/pplumbing.pp-tty/Pp_tty/index.html

Module Pp_ttySource

Build pretty printed documents for the user.

Sourcemodule Ansi_color : sig ... end

Build pretty printed documents with ansi colors.

Sourcemodule Style : sig ... end

Symbolic styles that can be used inside messages. These styles are later converted to actual concrete styles depending on the output device. For instance, when printed to the terminal they are converted to ansi terminal styles (Ansi_color.Style.t list values).

Styled document that can be printed to the console or in the log file.

Sourcemodule Print_config : sig ... end
Sourceval print : ?config:Print_config.t -> t -> unit

Print to stdout (not thread safe)

Sourceval prerr : ?config:Print_config.t -> t -> unit

Print to stderr (not thread safe)

Sourceval tag : Style.t -> t -> t

An alias for Pp.tag dedicated to the expected Style.t type. Using this function allows to write the Style.t constructor without qualifying them, which may be more ergonomic.

Basic helpers

Sourceval parens : 'a Pp.t -> 'a Pp.t
Sourceval brackets : 'a Pp.t -> 'a Pp.t
Sourceval braces : 'a Pp.t -> 'a Pp.t
Sourceval simple_quotes : 'a Pp.t -> 'a Pp.t
Sourceval double_quotes : 'a Pp.t -> 'a Pp.t

Opinionated helpers

Sourceval loc : Loc.t -> t

A pretty printer for code locations. The uses a common syntax that is usually configured by editors to allow jumping to locations. If the file listed by the location is available, this will render a small quotation for the location, such as in:

  File "my-file", line 42, character 6-11:
  42 | Hello World
             ^^^^^
Sourcemodule type To_string = sig ... end
Sourceval id : (module To_string with type t = 'a) -> 'a -> t

A modular-explicit helper that uses brackets and the Id symbolic style to format a stringable identifier.

Sourceval kwd : (module To_string with type t = 'a) -> 'a -> t

A modular-explicit helper that uses brackets and the Kwd symbolic style to format a stringable keyword.

Sourceval path : (module To_string with type t = 'a) -> 'a -> t

A modular-explicit helper that uses double_quotes and the Bold ansi style to format a stringable path.

Sourceval ansi : (module To_string with type t = 'a) -> 'a -> Ansi_color.Style.t list -> t

A modular-explicit helper that uses the ansi style to format a stringable variable.

OCaml

Innovation. Community. Security.