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.
ElmBook.Internal.Application.BookApplication state html
ElmBook.Internal.Book.BookBuilder state html
ElmBook.Internal.Chapter.ChapterCustom state html
ElmBook.Internal.Msg.Msg state
customBook : (html -> Html (Msg state)) -> String -> BookBuilder state html