zenacy-html-2.0.2: A standard compliant HTML parsing library

Safe HaskellNone
LanguageHaskell2010

Zenacy.HTML.Internal.Oper

Description

Defines operations on html data types.

Synopsis

Documentation

htmlNodeIsElem :: HTMLNode -> Bool Source #

Determines if a node is an element node.

htmlNodeIsText :: HTMLNode -> Bool Source #

Determines if a node is a text node.

htmlNodeContent :: HTMLNode -> [HTMLNode] Source #

Gets the content of a node.

htmlNodeContentSet :: [HTMLNode] -> HTMLNode -> HTMLNode Source #

Sets the content of a node.

htmlNodeShow :: HTMLNode -> String Source #

Shows the node without its content.

htmlNodeFind :: (HTMLNode -> Bool) -> HTMLNode -> Maybe HTMLNode Source #

Finds a child node using a predicate.

htmlNodeCount :: (HTMLNode -> Bool) -> HTMLNode -> Int Source #

Counts the number of nodes matching a predicate.

htmlNodeCountM :: Monad m => (HTMLNode -> m Bool) -> HTMLNode -> m Int Source #

Counts the number of nodes matching a predicate.

htmlTextSpace :: HTMLNode -> Bool Source #

Determines if a node is a text node containing only whitespace.

htmlTextAppend :: Text -> HTMLNode -> HTMLNode Source #

Appends text to a text node.

htmlTextPrepend :: Text -> HTMLNode -> HTMLNode Source #

Prepends text to a text node.

htmlAttrHasName :: Text -> HTMLAttr -> Bool Source #

A predicate for checking attribute names.

htmlAttrRename :: Text -> HTMLAttr -> HTMLAttr Source #

Renames an attribute.

htmlElemAttr :: HTMLNode -> [HTMLAttr] Source #

Gets the attributes for an element.

htmlElemAttrCount :: HTMLNode -> Int Source #

Gets the number of attributes for an element.

htmlElemAttrFind :: (HTMLAttr -> Bool) -> HTMLNode -> Maybe HTMLAttr Source #

Finds an attribute for an element.

htmlElemAttrFindName :: Text -> HTMLNode -> Maybe HTMLAttr Source #

Finds an attribute by name for an element.

htmlElemAttrApply :: ([HTMLAttr] -> [HTMLAttr]) -> HTMLNode -> HTMLNode Source #

Applies a function to the attributes for an element.

htmlElemAttrFilter :: (HTMLAttr -> Bool) -> HTMLNode -> HTMLNode Source #

Filters the attributes for an element.

htmlElemAttrMap :: (HTMLAttr -> HTMLAttr) -> HTMLNode -> HTMLNode Source #

Maps an endofunctor over an element attributes.

htmlElemHasAttr :: HTMLNode -> Bool Source #

Determines if the element has attributes.

htmlElemHasAttrName :: Text -> HTMLNode -> Bool Source #

Determines if an element has an attribute.

htmlElemHasAttrVal :: Text -> Text -> HTMLNode -> Bool Source #

Determines if an element has an attribute value.

htmlElemHasAttrValInfix :: Text -> Text -> HTMLNode -> Bool Source #

Determines if an element has part of an attribute value.

htmlElemAddAttr :: HTMLAttr -> HTMLNode -> HTMLNode Source #

Adds an attribute to an element.

htmlElemSetAttr :: Text -> Text -> HTMLNode -> HTMLNode Source #

Sets an attribute value.

htmlElemGetAttr :: Text -> HTMLNode -> Maybe Text Source #

Gets an attribute value.

htmlElemAttrRemove :: Text -> HTMLNode -> HTMLNode Source #

Removes an attribute from an element.

htmlElemRemoveAllAttr :: HTMLNode -> HTMLNode Source #

Removes all attributes from an element.

htmlElemAttrRename :: Text -> Text -> HTMLNode -> HTMLNode Source #

Renames an attribute for an element.

htmlElemID :: HTMLNode -> Maybe Text Source #

Gets the id attribute for an element.

htmlElemIDSet :: Text -> HTMLNode -> HTMLNode Source #

Sets the id attribute for an element.

htmlElemHasID :: Text -> HTMLNode -> Bool Source #

Determines if an element has an id.

htmlElemFindID :: Text -> HTMLNode -> Maybe HTMLNode Source #

Searches for an element with an id.

htmlElemClass :: HTMLNode -> Maybe Text Source #

Gets the id attribute for an element.

htmlElemClassSet :: Text -> HTMLNode -> HTMLNode Source #

Sets the class attribute for an element.

htmlElemClasses :: HTMLNode -> Set Text Source #

Gets the element classes.

htmlElemClassesSet :: Set Text -> HTMLNode -> HTMLNode Source #

Sets the element classes.

htmlElemClassesAdd :: Text -> HTMLNode -> HTMLNode Source #

Adds the class to the element's classes.

htmlElemClassesRemove :: Text -> HTMLNode -> HTMLNode Source #

Removes a class from the element's classes.

htmlElemClassesContains :: Text -> HTMLNode -> Bool Source #

Determines if the element contains a class.

htmlElemStyle :: HTMLNode -> Maybe Text Source #

Gets the style attribute for an element.

htmlElemStyles :: HTMLNode -> Map Text Text Source #

Gets the styles for an element.

htmlElemStyleParseURL :: Text -> Maybe Text Source #

Parses and returns a url style value.

htmlElemContent :: HTMLNode -> [HTMLNode] Source #

Gets the children for the element if the node is an element.

htmlElemContentSet :: [HTMLNode] -> HTMLNode -> HTMLNode Source #

Sets the content for an element.

htmlElemHasContent :: HTMLNode -> Bool Source #

Determines if the element has children.

htmlElemNodeFirst :: HTMLNode -> Maybe HTMLNode Source #

Gets the first child for an element.

htmlElemNodeLast :: HTMLNode -> Maybe HTMLNode Source #

Gets the last child for an element.

htmlElemNodeCount :: HTMLNode -> Int Source #

Gets the number of children for an element.

htmlElemName :: HTMLNode -> Text Source #

Gets the name of an element.

htmlElemHasName :: Text -> HTMLNode -> Bool Source #

Checks if the name of an element matches a specified name.

htmlElemRename :: Text -> HTMLNode -> HTMLNode Source #

Sets the name of an element.

htmlElemFindElem :: (HTMLNode -> Bool) -> HTMLNode -> Maybe HTMLNode Source #

Finds a child element using a predicate.

htmlElemFindElemNamed :: Text -> HTMLNode -> Maybe HTMLNode Source #

Finds a child element with a specified name.

htmlElemHasElem :: (HTMLNode -> Bool) -> HTMLNode -> Bool Source #

Determines if an element has a child.

htmlElemHasElemNamed :: Text -> HTMLNode -> Bool Source #

Determines if an element has a child.

htmlElemContentApply :: ([HTMLNode] -> [HTMLNode]) -> HTMLNode -> HTMLNode Source #

Modifies an elements children by applying a function.

htmlElemContentMap :: (HTMLNode -> HTMLNode) -> HTMLNode -> HTMLNode Source #

Modifies an elements children by mapping a function over them.

htmlElemContentFilter :: (HTMLNode -> Bool) -> HTMLNode -> HTMLNode Source #

Modifies an elements children by filtering them.

htmlElemSearch :: (HTMLNode -> Bool) -> HTMLNode -> Maybe HTMLNode Source #

Finds an element using a depth-first search.

htmlElemText :: HTMLNode -> Maybe Text Source #

Gets the text content for an element.

htmlDocHtml :: HTMLNode -> Maybe HTMLNode Source #

Finds the html element given a document.

htmlDocBody :: HTMLNode -> Maybe HTMLNode Source #

Finds the body element given a document.

htmlDocHead :: HTMLNode -> Maybe HTMLNode Source #

Finds the head element given a document.

htmlDocTitle :: HTMLNode -> Maybe Text Source #

Finds the title for a document.

htmlMapElem :: (HTMLNode -> HTMLNode) -> HTMLNode -> HTMLNode Source #

Maps a function over all the elements defined by a node.

htmlMapElemM :: Monad m => (HTMLNode -> m HTMLNode) -> HTMLNode -> m HTMLNode Source #

Maps a function over all the elements defined by a node.

htmlElemCollapse :: (HTMLNode -> Bool) -> HTMLNode -> [HTMLNode] Source #

Collapses a tree of elements based on a predicate.

htmlElemCollapseM :: Monad m => (HTMLNode -> m Bool) -> HTMLNode -> m [HTMLNode] Source #

Collapses a tree of elements based on a predicate.