-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | HTML rewrite engine, using KURE. -- @package html-kure @version 0.2.1 module Text.HTML.KURE -- | parsing HTML files. If you want to unparse, use show. parseHTML :: FilePath -> String -> HTML -- | element is the main way of generates a element in HTML. element :: String -> [Attr] -> HTML -> HTML -- | text creates a HTML node with text inside it. text :: String -> HTML -- | build a single Attr. Short version of attrC. attr :: String -> String -> Attr -- | zero is an empty piece of HTML, which can be used to avoid the -- use of the <tag/> form; for example "element "br" [] zero" will -- generate both an opener and closer. zero is the same as "text -- """. zero :: HTML -- | htmlT take arrows that operate over elements, texts, and -- syntax, and returns a transformation over 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 -- | mconcat over HTML htmlC :: [HTML] -> HTML -- | elementT take arrows that operate over attributes and (the -- inner) HTML, and returns a transformation over a single element. elementT :: Monad m => Transform Context m Attrs a -> Transform Context m HTML b -> (String -> a -> b -> x) -> Transform Context m Element x -- | elementC builds a element from its components. elementC :: String -> Attrs -> HTML -> Element -- | textT takes a Text to bits. The string is fully unescaped (a -- regular Haskell string) textT :: Monad m => (String -> x) -> Transform Context m Text x -- | textC constructs a Text from a fully unescaped string. textC :: String -> Text -- | attrsT promotes a transformation over Attr into a -- transformation over Attrs. attrsT :: Monad m => Transform Context m Attr a -> ([a] -> x) -> Transform Context m Attrs x -- | join attributes together. attrsC :: [Attr] -> Attrs -- | promote a function over an attributes components into a transformation -- over Attr. attrT :: Monad m => (String -> String -> x) -> Transform Context m Attr x -- | Create a single attribute. attrC :: String -> String -> Attr -- | getAttr gets the attributes of a specific attribute of a -- element. getAttr :: MonadCatch m => String -> Transform Context m Element String -- | isTag checks the element for a specific element name. isTag :: Monad m => String -> Transform Context m Element () -- | getTag gets the element name. getTag :: Monad m => Transform Context m Element String -- | getAttrs gets the attributes inside a element. getAttrs :: Monad m => Transform Context m Element Attrs -- | getInner gets the HTML inside a element. getInner :: Monad m => Transform Context m Element HTML -- | 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. anyElementHTML :: MonadCatch m => Transform Context m Element HTML -> Rewrite Context m HTML -- | Flatten into singleton HTMLs. The opposite of mconcat. unconcatHTML :: HTML -> [HTML] -- | The Principal type in DSL. Use show to get the String rendition -- of this type. HTML is concatenated using <>, the -- Monoid mappend. data HTML -- | HTML element with tag and attrs data Element -- | Text (may include escaped text internally) data Text -- | Attributes for a element data Attrs -- | Single attribute data Attr -- | XML/HTML syntax, like <? or <!, or our zero-width space -- zero. data Syntax -- | Context contains all the containing elements in an inside to outside -- order newtype Context Context :: [Element] -> Context -- | Our universal node type. Only used during generic tree walking and -- traversals. data Node class Html a html :: Html a => a -> HTML 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 instance Show Node instance Html Syntax instance Html Text instance Html Element instance Walker Context Node instance Injection Syntax Node instance Injection Attr Node instance Injection Attrs Node instance Injection Text Node instance Injection Element Node instance Injection HTML Node instance Monoid Context instance Monoid HTML instance Show Syntax instance Show Attr instance Show Attrs instance Show Text instance Show Element instance Show HTML