package slipshow

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

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;
  4. highlightjs_theme : string option;
  5. math_mode : [ `Mathjax | `Katex ] option;
  6. external_ids : string list;
}
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 type Field = sig ... end
module type Field_with_default := sig ... end
Sourcemodule Toplevel_attributes : Field_with_default with type t = Cmarkit.Attributes.t
Sourcemodule Theme : Field_with_default with type t = [ `Builtin of Themes.t | `External of string ]
Sourcemodule Dimension : Field_with_default with type t = int * int
Sourcemodule Hljs_theme : Field_with_default with type t = string
Sourcemodule Math_mode : Field_with_default with type t = [ `Mathjax | `Katex ]
Sourceval empty : resolved t
Sourceval of_string : string -> int -> string -> unresolved t
Sourcetype extraction = {
  1. frontmatter : string;
  2. rest : string;
  3. rest_offset : int * int;
  4. fm_offset : int;
}
Sourceval extract : string -> extraction option

Split the frontmatter and the rest of the input string, still computing offsets

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