Safe Haskell | None |
---|---|
Language | Haskell98 |
- parseHTML :: FilePath -> String -> HTML
- element :: String -> [Attr] -> HTML -> HTML
- text :: String -> HTML
- attr :: String -> String -> Attr
- zero :: HTML
- htmlT :: Monad m => Transform Context m Element a -> Transform Context m Text a -> Transform Context m Syntax a -> ([a] -> x) -> Transform Context m HTML x
- htmlC :: [HTML] -> HTML
- elementT :: Monad m => Transform Context m Attrs a -> Transform Context m HTML b -> (String -> a -> b -> x) -> Transform Context m Element x
- elementC :: String -> Attrs -> HTML -> Element
- textT :: Monad m => (String -> x) -> Transform Context m Text x
- textC :: String -> Text
- attrsT :: Monad m => Transform Context m Attr a -> ([a] -> x) -> Transform Context m Attrs x
- attrsC :: [Attr] -> Attrs
- attrT :: Monad m => (String -> String -> x) -> Transform Context m Attr x
- attrC :: String -> String -> Attr
- getAttr :: MonadCatch m => String -> Transform Context m Element String
- isTag :: Monad m => String -> Transform Context m Element ()
- getTag :: Monad m => Transform Context m Element String
- getAttrs :: Monad m => Transform Context m Element Attrs
- getInner :: Monad m => Transform Context m Element HTML
- anyElementHTML :: MonadCatch m => Transform Context m Element HTML -> Rewrite Context m HTML
- unconcatHTML :: HTML -> [HTML]
- data HTML
- data Element
- data Text
- data Attrs
- data Attr
- data Syntax
- newtype Context = Context [Element]
- data Node
- class Html a where
- injectT' :: (Monad m, Injection a Node) => Transform c m a Node
- projectT' :: (Monad m, Injection a Node) => Transform c m Node a
- extractT' :: (Monad m, Injection a Node) => Transform c m Node b -> Transform c m a b
- promoteT' :: (Monad m, Injection a Node) => Transform c m a b -> Transform c m Node b
- extractR' :: (Monad m, Injection a Node) => Rewrite c m Node -> Rewrite c m a
- promoteR' :: (Monad m, Injection a Node) => Rewrite c m a -> Rewrite c m Node
Reading HTML
HTML Builders
element :: String -> [Attr] -> HTML -> HTML Source
element
is the main way of generates a element in HTML.
Primitive Traversal Combinators
htmlT :: Monad m => Transform Context m Element a -> Transform Context m Text a -> Transform Context m Syntax a -> ([a] -> x) -> Transform Context m HTML x Source
htmlT
take arrows that operate over elements, texts, and syntax,
and returns a transformation over HTML.
elementT :: Monad m => Transform Context m Attrs a -> Transform Context m HTML b -> (String -> a -> b -> x) -> Transform Context m Element x Source
elementT
take arrows that operate over attributes and (the inner) HTML,
and returns a transformation over a single element.
textT :: Monad m => (String -> x) -> Transform Context m Text x Source
textT
takes a Text to bits. The string is fully unescaped (a regular Haskell string)
attrT :: Monad m => (String -> String -> x) -> Transform Context m Attr x Source
promote a function over an attributes components into a transformation over Attr
.
Other Combinators and Observers
getAttr :: MonadCatch m => String -> Transform Context m Element String Source
getAttr
gets the attributes of a specific attribute of a element.
isTag :: Monad m => String -> Transform Context m Element () Source
isTag
checks the element for a specific element name.
getAttrs :: Monad m => Transform Context m Element Attrs Source
getAttrs
gets the attributes inside a element.
getInner :: Monad m => Transform Context m Element HTML Source
getInner
gets the HTML inside a element.
anyElementHTML :: MonadCatch m => Transform Context m Element HTML -> Rewrite Context m HTML Source
lifts mapping of Element
to HTML
over a single level of HTML
sub-nodes.
anyElementHTML
has the property ''anyElementHTML (arr html) = idR''.
This is successful only if any of the sub-transformations are successful.
unconcatHTML :: HTML -> [HTML] Source
Flatten into singleton HTMLs. The opposite of mconcat.
Types and Classes
XML/HTML syntax, like <? or <!, or our zero-width space zero
.
Context contains all the containing elements in an inside to outside order
Our universal node type. Only used during generic tree walking and traversals.