tricycle/elm-actor-framework-template-html/1.1.2

NOTE: the latest version is 1.1.3

Renamed to bellroy/elm-actor-framework-template-html. It is published under that name, and new versions come out there.

Versions published as tricycle/elm-actor-framework-template-html still install under that name. 2 versions of 6 come from the new location (see their notes). 4 versions could not be recovered and cannot be installed.

Unavailable. Nobody can download this version any more, with elm or with the Lamdera compiler: github.com/bellroy/elm-actor-framework-template-html exists but has no tag 1.1.2; Software Heritage not asked yet (this run's --swh-calls were used up); no fork with tag 1.1.2 found (1 same-name repos checked); no cached copy. Use another version.

Details

Framework.Template.Html

type alias HtmlTemplate appActors =
HtmlTemplate appActors

Your parsed template that originated from a string containing valid Html

Creation

blank : HtmlTemplate appActors

An empty, blank HtmlTemplate

Components appActors
-> String
-> Result String (HtmlTemplate appActors)

Parse a string containing valid Html into an HtmlTemplate

Add Components to replace Html Elements with your Actors based on their nodeNames. (e.g. <my-actor></my-actor>)

fromNodes : List (Node appActors) -> HtmlTemplate appActors

Turn a list of Nodes into an HtmlTemplate

This could be useful for when you use your own Html Parser.

Rendering

toNodes : HtmlTemplate appActors -> List (Node appActors)

Turn a HtmlTemplate into a list of Nodes

This could be useful for when you want to write or use another method of rendering the template in question.

Dict String Pid
-> (Pid -> Maybe (Html msg))
-> HtmlTemplate appActors
-> List (Html msg)

Render your template

Dict String Pid
-> Dict String String
-> (Pid -> Maybe (Html msg))
-> HtmlTemplate appActors
-> List (Html msg)

Render your template and interpolate any string matching your interpolation dictionary.

renderAndInterpolate
    Dict.empty
    (Dict.fromList [ ( "foo", "bar" ) ])
    (fromNodes [ Text "<p>#[foo]</p>" ])
    temmplate
toString : HtmlTemplate appActors -> String

Turn a HtmlTemplate into a string

Utility

HtmlTemplate appActors
-> List
{ actor : appActors
, reference : String
, actorElement : ActorElement appActors
}

Get the actor, reference and original complete node from a template that are meant to be spawned.

The String is a reference that can be used on the render function in combination with a Pid to render the Actors output.