Serum.Fragment (serum v1.5.1) View Source

Defines a struct representing a page fragment.

Fields

  • file: Source path. This can be nil if created internally.
  • output: Destination path
  • metadata: A map holding extra information about the fragment
  • data: Contents of the page fragment

Link to this section Summary

Functions

Creates a new Fragment struct.

Link to this section Types

Specs

t() :: %Serum.Fragment{
  data: binary(),
  file: binary() | nil,
  metadata: map(),
  output: binary()
}

Link to this section Functions

Link to this function

new(file, output, metadata, data)

View Source

Specs

new(binary() | nil, binary(), map(), binary()) :: Result.t(t())

Creates a new Fragment struct.