Module

Text.Smolder.Markup

Package
purescript-smolder
Repository
bodil/purescript-smolder

#MarkupM Source

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 Source

type Markup e = Free (MarkupM e) Unit

The type of a sequence of markup nodes.

#NS Source

data NS

Constructors

#Attr Source

data Attr

Constructors

#EventHandler Source

#mapEvent Source

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

Change the event type of a markup sequence.

#parent Source

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

Create a named parent node with a sequence of children.

#leaf Source

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

Create a named leaf node.

#text Source

text :: forall e. String -> Markup e

Create a text node.

#empty Source

empty :: forall e. Markup e

Used for empty nodes (without text or children)

#Attributable Source

class Attributable a  where

Members

Instances

#attribute Source

attribute :: String -> String -> Attribute

Create an attribute.

#(!) Source

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

#optionalWith Source

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

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

#(!?) Source

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

#EventHandlers Source

#Eventable Source

class Eventable e a | a -> e where

Members

Instances

#on Source

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

Construct an event handler for a named event.

#(#!) Source

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