package slipshow

  1. Overview
  2. Docs

Module Slipshow.FrontmatterSource

Sourcetype resolved = [
  1. | `Resolved
]
Sourcetype unresolved = [
  1. | `Unresolved
]
Sourcetype 'a fm = {
  1. toplevel_attributes : Cmarkit.Attributes.t option;
  2. theme : [ `Builtin of Themes.t | `External of string ] option;
  3. dimension : (int * int) option;
}
Sourcetype 'a t =
  1. | Unresolved : string fm -> unresolved t
  2. | Resolved : Asset.t fm -> resolved t

We use this trick to only allow string fm and Asset.t fm, but it is completely unnecessary and a flagrant example of useless over-engineering.

Sourcemodule Default : sig ... end
Sourceval empty : resolved t
Sourcemodule String_to : sig ... end

This is used to convert each field from a string to its unresolved ocaml value. Used internally by extract, but also externally by the CLI converters.

Sourceval of_string : string -> (unresolved t, [> `Msg of string ]) result
Sourceval extract : string -> (string * string) option

The first string is the frontmatter, the second one the original string with the frontmatter and separator stripped

Sourceval combine : resolved t -> resolved t -> resolved t
Sourceval resolve : unresolved t -> to_asset:(string -> Asset.t) -> resolved t