package mehari

  1. Overview
  2. Docs

Module Mehari.GemtextSource

Implementation of Gemtext, the Gemini own native response format.

Note that if a string containing line breaks (CR or CRLF) is given to functions heading, list_item and quote only the first line will be formatted and the others treated as normal text. To avoid this behavior, see Mehari.paragraph.

      open Mehari.Gemtext

let () = assert ([ quote "hello\nworld" ] = [ quote "hello"; text "world" ])
Sourcetype t = line list
Sourceand line =
  1. | Text of string
  2. | Preformat of preformat
  3. | Heading of [ `H1 | `H2 | `H3 ] * string
  4. | ListItem of string
  5. | Quote of string
Sourceand preformat = {
  1. alt : string option;
  2. text : string;
}
Sourceval line_to_string : line -> string
Sourceval of_string : string -> t
Sourceval to_string : t -> string

Facilities

Sourceval text : string -> line
Sourceval newline : line

newline is text "".

Sourceval preformat : ?alt:string -> string -> line
Sourceval heading : [ `H1 | `H2 | `H3 ] -> string -> line
Sourceval list_item : string -> line
Sourceval quote : string -> line
Sourceval pp_line : Format.formatter -> line -> unit
Sourceval pp : Format.formatter -> t -> unit
OCaml

Innovation. Community. Security.