Expresso.Slide (expresso v0.1.0)

Copy Markdown View Source

A slide

Summary

Functions

Make the assigns of a slide template from a slide

Write the options of the DSL into the metadata of the slide

Types

t()

@type t() :: %Expresso.Slide{
  __spark_metadata__: term(),
  auto_reveal: boolean() | nil,
  class: String.t() | nil,
  easing: atom() | nil,
  effect: atom() | nil,
  elements: list(),
  handout: Expresso.Handout.t() | nil,
  heading: String.t() | nil,
  labels: [String.t() | nil] | nil,
  meta: keyword() | nil,
  metadata: map() | nil,
  morph: :auto | :named | :off | nil,
  name: String.t() | nil,
  notes: String.t() | nil,
  section: String.t() | nil,
  speed: atom() | pos_integer() | nil,
  sr_heading: boolean() | nil,
  steps: pos_integer() | nil,
  template: module() | {:builtins, atom()} | nil,
  transition: atom() | nil
}

Functions

get_assigns(slide)

@spec get_assigns(t()) :: %{
  name: String.t() | nil,
  metadata: map() | nil,
  elements: list()
}

Make the assigns of a slide template from a slide

put_options_in_metadata(slide)

@spec put_options_in_metadata(t()) :: t()

Write the options of the DSL into the metadata of the slide

The slide entity puts the heading option into the heading field, and the notes option into the notes field. The templates and the renderer read each from the metadata. The meta option holds the values of the user, and they stay under the key :meta, so a value cannot replace a key of Expresso. This function puts each option that is not nil into the metadata, and it gives the metadata an empty map when the field is nil.