DevJoy.Scene.Part (DevJoy v2.0.0)

View Source

A part is a group of scene items Multiple parts within a scene can be used to separate scene content.

Usage

The part always requires its page title and items.

defmodule MyApp.SceneName do
  use DevJoy.Scene

  part :part_name do
    # DSL for part items goes here
  end
end

Navigation tips

  • Use goto/0 macro to navigate to :main part in the same scene.
  • Use goto/1 macro to navigate to part in the same scene.
  • Use goto/2 macro to navigate to part in a different scene.

Summary

Field types

The type representing the additional data of the part.

The type representing the part's name.

The type representing the page's title.

Main

The part structure contains the following keys

t()

The type representing the part structure.

Field types

data()

@type data() :: Keyword.t()

The type representing the additional data of the part.

name()

@type name() :: atom()

The type representing the part's name.

page_title()

@type page_title() :: String.t()

The type representing the page's title.

Main

%DevJoy.Scene.Part{}

(struct)

The part structure contains the following keys:

  • data - a keyword list of additional part data
  • name - a name of the part
  • page_title - a title of the page
  • scene - a scene module for the part

t()

@type t() :: %DevJoy.Scene.Part{
  data: data(),
  name: name(),
  page_title: page_title() | nil,
  scene: DevJoy.Scene.t()
}

The type representing the part structure.