dtwrks/elm-book/1.2.0

NOTE: the latest version is 1.5.1

ElmBook.Custom

Use this module to integrate other rendering engines to ElmBook such as Elm-UI and Elm-CSS. Lets see how we would integrate Elm-UI and ElmBook:

module ElmBook.ElmUI exposing (Book, Chapter, book)


import Element exposing (Element, layout)
import ElmBook.Custom exposing (customBook)


type alias Html state =
    Element (ElmBook.Custom.Msg state)


type alias BookBuilder state =
    ElmBook.Custom.BookBuilder state (Html state)


type alias Book state =
    ElmBook.Custom.Book state (Html state)


type alias Chapter state =
    ElmBook.Custom.Chapter state (Html state)


book : String -> BookBuilder state
book =
    customBook (layout [])

After that you would only need to use this custom book function and Book type when creating a new book and the custom Chapter definition when creating a new chapter.

type alias Book state html =
BookApplication state html
type alias BookBuilder state html =
BookBuilder state html
type alias Chapter state html =
ChapterCustom state html
type alias Msg state =
Msg state
customBook : (html -> Html (Msg state)) -> String -> BookBuilder state html