Module

Text.Smolder.Markup

#MarkupM

data MarkupM e a

Representation of a markup node.

This is either an Element, which maps to a DOM element, a Content node, which maps to a DOM text node, or Empty, which maps to an empty NodeList.

Constructors

Instances

#Markup

type Markup e = Free (MarkupM e) Unit

The type of a sequence of markup nodes.

#NS

data NS

Constructors

#Attr

data Attr

Constructors

#EventHandler

#mapEvent

mapEvent :: forall l r. (l -> r) -> (Free (MarkupM l)) ~> (Free (MarkupM r))

Change the event type of a markup sequence.

#parent

parent :: forall e. NS -> String -> Markup e -> Markup e

Create a named parent node with a sequence of children.

#leaf

leaf :: forall e. NS -> String -> Markup e

Create a named leaf node.

#text

text :: forall e. String -> Markup e

Create a text node.

#empty

empty :: forall e. Markup e

Used for empty nodes (without text or children)

#Attributable

class Attributable a  where

Members

Instances

#attribute

attribute :: String -> String -> Attribute

Create an attribute.

#(!)

Operator alias for Text.Smolder.Markup.with (left-associative / precedence 4)

#optionalWith

optionalWith :: forall h. Attributable h => h -> Boolean -> Attribute -> h

Add an attribute to a markup node only if the supplied boolean value is true.

#(!?)

Operator alias for Text.Smolder.Markup.optionalWith (left-associative / precedence 4)

#EventHandlers

#Eventable

class Eventable e a | a -> e where

Members

Instances

#on

on :: forall e. String -> e -> EventHandlers e

Construct an event handler for a named event.

#(#!)

Operator alias for Text.Smolder.Markup.withEvent (left-associative / precedence 4)

Modules