Transmutable.Html.Interior

This module contains the core building blocks that make up the AST.

⚠️ This module should only be used by code that transmutes HTML. If you just want to write HTML, use the main Html module and the other modules such as Html.Attributes.

Types

type Html msg
= Cdata String
| Comment String
| Declaration String
| Node NodeProperties (Array (Attribute msg)) (Descendants msg)
| ProcessingInstruction String
| TextNode String
type Attribute msg
= Attribute String String
| BoolProperty String Bool
| Event String (EventDecoder msg)
| StringProperty String String
| Style String String
| ValueProperty String Value
type EventDecoder msg
= Normal (Decoder msg)
| MayStopPropagation (Decoder { message : msg, stopPropagation : Bool })
| MayPreventDefault (Decoder { message : msg, preventDefault : Bool })
| Custom (Decoder { message : msg, stopPropagation : Bool, preventDefault : Bool })
type alias NodeProperties = { key : Maybe String, tagName : String }
type Descendants msg
= Regular (Array (Html msg))

Transmute

transmute :
{ node : NodeProperties -> Array (Attribute msg)
-> TransmuteContext -> outcome, injectDescendants : outcome -> Array transmuted -> TransmuteContext -> transmuted , cdata : TransmuteContext -> String -> transmuted , comment : TransmuteContext -> String -> transmuted , declaration : TransmuteContext -> String -> transmuted , processingInstruction : TransmuteContext -> String -> transmuted , text : TransmuteContext -> String -> transmuted }
-> Html msg
-> transmuted

Use this helper function to translate Html into another data type.

Mapping

map : (a -> b) -> Html a -> Html b