allo-media/fable/1.0.1

NOTE: the latest version is 1.0.3

Fable

Fable allows you to create a book (like a repository) of your html views, they are grouped as chapters, stories.

App

app : List (Chapter msg) -> Book msg

Launch a fable application with a list of chapters

  main : Book Msg
  main =
      Fable.app []

Model

type alias Book msg =
Program () (Model msg) (Msg msg)

Book application type

main : Book Msg
main =
    let
        chapters =
            [ Fable.chapter "chapter1" [] ]
    in
    Fable.app chapters

Element

chapter : String -> List (Story msg) -> Chapter msg

Chapter represents a category like Forms, Blocks, or whatever. It needs an unique id.

  chapters = [
    Fable.chapter "chapter 1" []
  ]
story : String -> List (Ui msg) -> Story msg

Story represents a list of element html (like input with different state). It needs an unique id.

  stories = [
    Fable.story "story 1" []
  ]
ui : String -> Html msg -> Ui msg

Ui represents an element of your view. It needs an unique id.

  ui = [
    Fable.ui "ui 1" (div [] [])
  ]