-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | A standard compliant HTML parsing library
--
-- Zenacy HTML is an HTML parsing and processing library that implements
-- the WHATWG HTML parsing standard. The standard is described as a state
-- machine that this library implements exactly as spelled out including
-- all the error handling, recovery, and conformance checks that makes it
-- robust in handling any HTML pulled from the web. In addition to
-- parsing, the library provides many processing features to help extract
-- information from web pages or rewrite them and render the modified
-- results.
@package zenacy-html
@version 2.0.2
-- | Functions for identifying and manipulating character codes.
module Zenacy.HTML.Internal.Char
-- | Converts a character to a Word8.
ctow :: Char -> Word8
-- | Determines if a character code is in the range of a Word8.
chrWord8 :: Int -> Bool
-- | Decodes a UTF8 unicode character.
chrUTF8 :: Int -> [Word8]
-- | Determines if a character code is a surrogate.
chrSurrogate :: Int -> Bool
-- | Determines if a character code is a scalar.
chrScalar :: Int -> Bool
-- | Determines if a code is a not a character code.
chrNonCharacter :: Int -> Bool
-- | Determines if a character is an ASCII digit.
chrASCIIDigit :: Word8 -> Bool
-- | Determines if a character is an ASCII uppercase hex digit.
chrASCIIUpperHexDigit :: Word8 -> Bool
-- | Determines if a character is an ASCII lowercase hex digit.
chrASCIILowerHexDigit :: Word8 -> Bool
-- | Determines if a character is an ASCII hex digit (any case).
chrASCIIHexDigit :: Word8 -> Bool
-- | Determines if a character is an ASCII uppercase alpha character.
chrASCIIUpperAlpha :: Word8 -> Bool
-- | Determines if a character is an ASCII lowercase alpha character.
chrASCIILowerAlpha :: Word8 -> Bool
-- | Determines if a character is an ASCII alpha character (any case).
chrASCIIAlpha :: Word8 -> Bool
-- | Determines if a character is an ASCII alphanumeric character (any
-- case).
chrASCIIAlphanumeric :: Word8 -> Bool
-- | Determines if a character is a whitespace character.
chrWhitespace :: Word8 -> Bool
-- | Determines if a character is a C0 control character.
chrC0Control :: Word8 -> Bool
-- | Determines if a character is a control character.
chrControl :: Word8 -> Bool
-- | Converts a character to uppercase.
chrToUpper :: Word8 -> Word8
-- | Converts a character to lowercase.
chrToLower :: Word8 -> Word8
-- | Character code for ampersand.
chrAmpersand :: Word8
-- | Character code for EOF.
chrEOF :: Word8
-- | Character code for exclamation.
chrExclamation :: Word8
-- | Character code for greater.
chrGreater :: Word8
-- | Character code for less.
chrLess :: Word8
-- | Character code for question.
chrQuestion :: Word8
-- | Character code for solidus (slash).
chrSolidus :: Word8
-- | Character code for tab.
chrTab :: Word8
-- | Character code for line feed.
chrLF :: Word8
-- | Character code for form feed.
chrFF :: Word8
-- | Character code for carraige return.
chrCR :: Word8
-- | Character code for space.
chrSpace :: Word8
-- | Character code for equal.
chrEqual :: Word8
-- | Character code for quote.
chrQuote :: Word8
-- | Character code for apostrophe.
chrApostrophe :: Word8
-- | Character code for grave.
chrGrave :: Word8
-- | Character code for number sign.
chrNumberSign :: Word8
-- | Character code for hyphen.
chrHyphen :: Word8
-- | Character code for right bracket.
chrBracketRight :: Word8
-- | Character code for semicolon.
chrSemicolon :: Word8
-- | Character code for upper x.
chrUpperX :: Word8
-- | Character code for lower x.
chrLowerX :: Word8
-- | Convenience wrappers and utilities for byte strings.
module Zenacy.HTML.Internal.BS
-- | A type abbreviation for a byte string.
type BS = ByteString
-- | An empty byte string.
bsEmpty :: BS
-- | A byte string with only one character.
bsOnly :: Word8 -> BS
-- | Gets the length of a byte string.
bsLen :: BS -> Int
-- | Converts a list of characters to a byte string.
bsPack :: [Word8] -> BS
-- | Converts a byte string to a list of characters.
bsUnpack :: BS -> [Word8]
-- | Concatenates byte strings into one.
bsConcat :: [BS] -> BS
-- | Gets the character at an index in a byte string.
bsIndex :: BS -> Int -> Word8
-- | Gets the index of a character in a byte string.
bsElemIndex :: Word8 -> BS -> Maybe Int
-- | Converts a bytestring to lowercase.
bsLower :: BS -> BS
-- | Determines if a bytestring is a case-insensitive prefix of another.
bsPrefixCI :: BS -> BS -> Bool
-- | Selects a substring for a byte string.
bsPart :: Int -> Int -> BS -> BS
-- | Returns the last word of a bytestring.
bsLast :: BS -> Maybe Word8
-- | Takes characters from a byte string.
bsTake :: Int -> BS -> BS
-- | Drops characters from a byte string.
bsDrop :: Int -> BS -> BS
-- | Removes a character from the end of a byte string.
bsUncons :: BS -> Maybe (Word8, BS)
-- | Converts a string to a byte string.
bcPack :: String -> BS
-- | Converts a bytestring to a string.
bcUnpack :: BS -> String
-- | Defines an buffer type.
module Zenacy.HTML.Internal.Buffer
-- | A type of buffer used to hold bytes.
data Buffer s
Buffer :: MVector s Int -> MVector s Word8 -> Buffer s
[bfCntl] :: Buffer s -> MVector s Int
[bfData] :: Buffer s -> MVector s Word8
-- | Makes a new buffer.
bufferNew :: ST s (STRef s (Buffer s))
-- | Gets the capacity of the buffer.
bufferCapacity :: STRef s (Buffer s) -> ST s (Int, Int)
-- | Gets the size of the buffer.
bufferSize :: STRef s (Buffer s) -> ST s Int
-- | Resets a buffer.
bufferReset :: STRef s (Buffer s) -> ST s ()
-- | Appends a word to a buffer.
bufferAppend :: Word8 -> STRef s (Buffer s) -> ST s ()
-- | Applies an action to each word in the buffer.
bufferApply :: (Word8 -> ST s ()) -> STRef s (Buffer s) -> ST s ()
-- | Takes elements from the front of the buffer.
bufferTake :: Int -> STRef s (Buffer s) -> ST s [Word8]
-- | Determines if a buffer has the specified contents.
bufferContains :: [Word8] -> STRef s (Buffer s) -> ST s Bool
-- | Packs a buffer into a byte string.
bufferPack :: STRef s (Buffer s) -> ST s BS
-- | Converts a storable vector to a byte string.
bufferString :: MVector s Word8 -> Int -> ST s BS
-- | Defines core functions that augment the prelude.
module Zenacy.HTML.Internal.Core
-- | Updates an STRef by applying a function to its value.
updateSTRef :: STRef s a -> (a -> a) -> ST s ()
-- | Abbreviation for reading an STRef.
rref :: STRef s a -> ST s a
-- | Abbreviation for writing an STRef.
wref :: STRef s a -> a -> ST s ()
-- | Abbreviation for updating an STRef.
uref :: STRef s a -> (a -> a) -> ST s ()
-- | Finds the element in a list that is the succeessor of the element
-- matching a predicate.
findSucc :: (a -> Bool) -> [a] -> Maybe a
-- | Inserts an element in a list before the element satisfied by a
-- predicate.
insertBefore :: (a -> Bool) -> a -> [a] -> [a]
-- | Removes the first item from a list that satisfies a predicate.
removeFirst :: (a -> Bool) -> [a] -> [a]
-- | Extracts a range of text bewteen two delimiters.
textExtract :: Text -> Text -> Text -> Maybe Text
-- | Returns a blank text of the specified length.
textBlank :: Int -> Text
-- | Converts a decimal string to a integer.
textReadDec :: Text -> Maybe Int
-- | Defines html image handling functions.
module Zenacy.HTML.Internal.Image
-- | Defines a srcset attribute value.
data HTMLSrcset
HTMLSrcset :: ![HTMLSrcsetCandidate] -> HTMLSrcset
[htmlSrcsetCandidates] :: HTMLSrcset -> ![HTMLSrcsetCandidate]
-- | Defines the image candidates.
data HTMLSrcsetCandidate
HTMLSrcsetCandidate :: !Text -> !HTMLSrcsetDescriptor -> HTMLSrcsetCandidate
[htmlSrcsetURL] :: HTMLSrcsetCandidate -> !Text
[htmlSrcsetDescriptor] :: HTMLSrcsetCandidate -> !HTMLSrcsetDescriptor
-- | Defines the srcset descriptor.
data HTMLSrcsetDescriptor
HTMLSrcsetWidth :: Int -> HTMLSrcsetDescriptor
HTMLSrcsetPixel :: Int -> HTMLSrcsetDescriptor
HTMLSrcsetNone :: HTMLSrcsetDescriptor
-- | Parses a srcset attribute value.
htmlSrcsetParse :: Text -> HTMLSrcset
-- | Parses a srcset candidate value.
htmlSrcsetParseCandidate :: Text -> Maybe HTMLSrcsetCandidate
-- | Parses a srcset descriptor value.
htmlSrcsetParseDescriptor :: Text -> HTMLSrcsetDescriptor
-- | Renders a srcset.
htmlSrcsetRender :: HTMLSrcset -> Text
-- | Renders a srcset candidate.
htmlSrcsetRenderCandidate :: HTMLSrcsetCandidate -> Text
-- | Renders a srcset descriptor.
htmlSrcsetRenderDescriptor :: HTMLSrcsetDescriptor -> Text
-- | Returns the URLs for a srcset.
htmlSrcsetListURL :: HTMLSrcset -> [Text]
-- | Maps a function over the srcset URLs.
htmlSrcsetMapURL :: (Text -> Text) -> HTMLSrcset -> HTMLSrcset
-- | Returns the smallest image in the srcset.
htmlSrcsetImageMin :: HTMLSrcset -> Text
-- | Returns the largest image in the srcset.
htmlSrcsetImageMax :: HTMLSrcset -> Text
-- | Gets the size of the descriptor.
htmlSrcsetDescriptorSize :: HTMLSrcsetDescriptor -> Int
-- | Converts a candidate to a pair.
htmlSrcsetCandidatePair :: HTMLSrcsetCandidate -> (Int, Text)
-- | Filter candidates from a srcset.
htmlSrcsetFilter :: (HTMLSrcsetCandidate -> Bool) -> HTMLSrcset -> HTMLSrcset
instance GHC.Classes.Ord Zenacy.HTML.Internal.Image.HTMLSrcset
instance GHC.Classes.Eq Zenacy.HTML.Internal.Image.HTMLSrcset
instance GHC.Show.Show Zenacy.HTML.Internal.Image.HTMLSrcset
instance GHC.Classes.Ord Zenacy.HTML.Internal.Image.HTMLSrcsetCandidate
instance GHC.Classes.Eq Zenacy.HTML.Internal.Image.HTMLSrcsetCandidate
instance GHC.Show.Show Zenacy.HTML.Internal.Image.HTMLSrcsetCandidate
instance GHC.Classes.Ord Zenacy.HTML.Internal.Image.HTMLSrcsetDescriptor
instance GHC.Classes.Eq Zenacy.HTML.Internal.Image.HTMLSrcsetDescriptor
instance GHC.Show.Show Zenacy.HTML.Internal.Image.HTMLSrcsetDescriptor
-- | A basic trie over byte strings.
module Zenacy.HTML.Internal.Trie
-- | Defines the tree.
data Trie a
-- | Creates an empty trie.
empty :: Trie a
-- | Creates a trie from a list of tuples containing key and value.
fromList :: [(BS, a)] -> Trie a
-- | Inserts a value into a trie.
insert :: BS -> a -> Trie a -> Trie a
-- | Inserts a value into a trie.
insertWords :: [Word8] -> a -> Trie a -> Trie a
-- | Finds the longest prefix with a value in the trie and returns the
-- prefix, the value, and the remaining string.
match :: Trie a -> BS -> Maybe (BS, a, BS)
instance GHC.Show.Show a => GHC.Show.Show (Zenacy.HTML.Internal.Trie.Trie a)
-- | Matches and extracts entities from byte strings.
module Zenacy.HTML.Internal.Entity
-- | Searches for an entity match. Returns a tuple with the prefix, its
-- value, and the remaining string.
entityMatch :: BS -> Maybe (BS, BS, BS)
-- | A trie of the entity data with surrogates converted.
entityTrie :: Trie BS
-- | The raw entity data.
entityData :: [(BS, String)]
-- | Defines supporting types.
module Zenacy.HTML.Internal.Types
-- | An HTML namespace type.
data HTMLNamespace
HTMLNamespaceHTML :: HTMLNamespace
HTMLNamespaceSVG :: HTMLNamespace
HTMLNamespaceMathML :: HTMLNamespace
-- | An HTML attribute namespace type.
data HTMLAttrNamespace
HTMLAttrNamespaceNone :: HTMLAttrNamespace
HTMLAttrNamespaceXLink :: HTMLAttrNamespace
HTMLAttrNamespaceXML :: HTMLAttrNamespace
HTMLAttrNamespaceXMLNS :: HTMLAttrNamespace
instance GHC.Show.Show Zenacy.HTML.Internal.Types.HTMLAttrNamespace
instance GHC.Classes.Ord Zenacy.HTML.Internal.Types.HTMLAttrNamespace
instance GHC.Classes.Eq Zenacy.HTML.Internal.Types.HTMLAttrNamespace
instance GHC.Show.Show Zenacy.HTML.Internal.Types.HTMLNamespace
instance GHC.Classes.Ord Zenacy.HTML.Internal.Types.HTMLNamespace
instance GHC.Classes.Eq Zenacy.HTML.Internal.Types.HTMLNamespace
instance Data.Default.Class.Default Zenacy.HTML.Internal.Types.HTMLAttrNamespace
instance Data.Default.Class.Default Zenacy.HTML.Internal.Types.HTMLNamespace
-- | Defines a token type used by the lexer.
module Zenacy.HTML.Internal.Token
-- | Defines the token type. The token type is used for testing and
-- debugging only.
data Token
TDoctype :: !BS -> !Bool -> !Maybe BS -> !Maybe BS -> Token
[tDoctypeName] :: Token -> !BS
[tDoctypeQuirks] :: Token -> !Bool
[tDoctypePublic] :: Token -> !Maybe BS
[tDoctypeSystem] :: Token -> !Maybe BS
TStart :: !BS -> !Bool -> ![TAttr] -> Token
[tStartName] :: Token -> !BS
[tStartClosed] :: Token -> !Bool
[tStartAttr] :: Token -> ![TAttr]
TEnd :: !BS -> Token
[tEndName] :: Token -> !BS
TComment :: !BS -> Token
[tCommentData] :: Token -> !BS
TChar :: !Word8 -> Token
[tCharData] :: Token -> !Word8
TEOF :: Token
-- | A type of buffer used to hold tokens.
data TokenBuffer s
TokenBuffer :: MVector s Int -> MVector s Word8 -> TokenBuffer s
[tbCntl] :: TokenBuffer s -> MVector s Int
[tbData] :: TokenBuffer s -> MVector s Word8
-- | An HTML element attribute type.
data TAttr
TAttr :: BS -> BS -> HTMLAttrNamespace -> TAttr
[tAttrName] :: TAttr -> BS
[tAttrVal] :: TAttr -> BS
[tAttrNamespace] :: TAttr -> HTMLAttrNamespace
-- | Makes an attribute.
tokenAttr :: BS -> BS -> TAttr
-- | Determines if a token has an attribute.
tokenHasAttr :: BS -> Token -> Bool
-- | Finds an attribute in a token.
tokenGetAttr :: BS -> Token -> Maybe TAttr
-- | Finds an attribute value for a token.
tokenGetAttrVal :: BS -> Token -> Maybe BS
-- | Makes a new token buffer.
tokenBuffer :: ST s (STRef s (TokenBuffer s))
-- | Gets the capacity of the buffer.
tokenCapacity :: STRef s (TokenBuffer s) -> ST s (Int, Int)
-- | Resets a token buffer.
tokenReset :: STRef s (TokenBuffer s) -> ST s ()
-- | Get the token buffer tail offset.
tokenTail :: STRef s (TokenBuffer s) -> ST s Int
-- | Positions the emitter to the first token and returns its offset.
tokenFirst :: STRef s (TokenBuffer s) -> ST s Int
-- | Positions the emitter to the next token and returns its offset.
tokenNext :: STRef s (TokenBuffer s) -> ST s Int
-- | Counts the number of tokens in the buffer.
tokenCount :: STRef s (TokenBuffer s) -> ST s Int
-- | Gets a list of the tokens in the buffer.
tokenOffset :: STRef s (TokenBuffer s) -> ST s [Int]
-- | Gets a list of the tokens in the buffer.
tokenList :: STRef s (TokenBuffer s) -> ST s [Token]
-- | Drops the last token from the buffer.
tokenDrop :: STRef s (TokenBuffer s) -> ST s ()
-- | Returns whether a buffer includes an EOF token.
tokenHasEOF :: STRef s (TokenBuffer s) -> ST s Bool
-- | Returns a slice of the data area of a token buffer.
tokenSlice :: Int -> Int -> STRef s (TokenBuffer s) -> ST s [Word8]
-- | Returns the start tag name at for the token at an offset.
tokenTagStartName :: Int -> STRef s (TokenBuffer s) -> ST s (Maybe [Word8])
-- | Returns the end tag name at for the token at an offset.
tokenTagEndName :: Int -> STRef s (TokenBuffer s) -> ST s (Maybe [Word8])
-- | Defines the type for a DOCTYPE token.
tokenDoctypeType :: Int
-- | Defines the type for a start tag token.
tokenTagStartType :: Int
-- | Defines the type for a end tag token.
tokenTagEndType :: Int
-- | Defines the type for a comment token.
tokenCommentType :: Int
-- | Defines the type for a character token.
tokenCharType :: Int
-- | Defines the type for an EOF token.
tokenEOFType :: Int
-- | Adds a new DOCTYPE token to the lexer.
tokenDoctypeInit :: STRef s (TokenBuffer s) -> ST s ()
-- | Appends a character to the current DOCTYPE token.
tokenDoctypeNameAppend :: Word8 -> STRef s (TokenBuffer s) -> ST s ()
-- | Sets the force quirks flag for the current DOCTYPE.
tokenDoctypeSetForceQuirks :: STRef s (TokenBuffer s) -> ST s ()
-- | Initializes the DOCTYPE public ID.
tokenDoctypePublicIdInit :: STRef s (TokenBuffer s) -> ST s ()
-- | Appends a character to the DOCTYPE public ID.
tokenDoctypePublicIdAppend :: Word8 -> STRef s (TokenBuffer s) -> ST s ()
-- | Initializes the DOCTYPE system ID.
tokenDoctypeSystemIdInit :: STRef s (TokenBuffer s) -> ST s ()
-- | Appends a character to the DOCTYPE system ID.
tokenDoctypeSystemIdAppend :: Word8 -> STRef s (TokenBuffer s) -> ST s ()
-- | Adds a new start tag to the lexer.
tokenTagStartInit :: STRef s (TokenBuffer s) -> ST s ()
-- | Adds a new start tag to the lexer.
tokenTagStartSetSelfClosing :: STRef s (TokenBuffer s) -> ST s ()
-- | Adds a new end tag to the lexer.
tokenTagEndInit :: STRef s (TokenBuffer s) -> ST s ()
-- | Appends a character to a tag name if the token is a tag.
tokenTagNameAppend :: Word8 -> STRef s (TokenBuffer s) -> ST s ()
-- | Starts a new attribute
tokenAttrInit :: STRef s (TokenBuffer s) -> ST s ()
-- | Appends a character to the latest attribute name.
tokenAttrNameAppend :: Word8 -> STRef s (TokenBuffer s) -> ST s ()
-- | Appends a character to the latest attribute value.
tokenAttrValAppend :: Word8 -> STRef s (TokenBuffer s) -> ST s ()
-- | Checks for duplicate attribute names. Refer to section 12.2.5.33 for
-- details.
tokenAttrNamePrune :: Int -> STRef s (TokenBuffer s) -> ST s Bool
-- | Adds a new comment token to the lexer.
tokenCommentInit :: STRef s (TokenBuffer s) -> ST s ()
-- | Appends a character to the current comment token.
tokenCommentAppend :: Word8 -> STRef s (TokenBuffer s) -> ST s ()
-- | Initializes a text token.
tokenCharInit :: Word8 -> STRef s (TokenBuffer s) -> ST s ()
-- | Initializes an EOF token.
tokenEOFInit :: STRef s (TokenBuffer s) -> ST s ()
-- | Gets the type of a token.
tokenType :: Int -> STRef s (TokenBuffer s) -> ST s Int
-- | Gets the size of a token.
tokenSize :: Int -> STRef s (TokenBuffer s) -> ST s Int
-- | Unpacks a token at the specified index.
tokenPack :: Int -> STRef s (TokenBuffer s) -> ST s Token
instance GHC.Show.Show Zenacy.HTML.Internal.Token.Token
instance GHC.Classes.Ord Zenacy.HTML.Internal.Token.Token
instance GHC.Classes.Eq Zenacy.HTML.Internal.Token.Token
instance GHC.Show.Show Zenacy.HTML.Internal.Token.TAttr
instance GHC.Classes.Ord Zenacy.HTML.Internal.Token.TAttr
instance GHC.Classes.Eq Zenacy.HTML.Internal.Token.TAttr
-- | The HTML Lexer.
module Zenacy.HTML.Internal.Lexer
-- | Defines the lexer state.
data Lexer s
Lexer :: BS -> Bool -> Bool -> STRef s Int -> STRef s (TokenBuffer s) -> STRef s (Buffer s) -> STRef s [Word8] -> STRef s LexerState -> STRef s LexerState -> STRef s LexerSkip -> STRef s (DList BS) -> STRef s Int -> Lexer s
-- | The lexer data.
[lexerData] :: Lexer s -> BS
-- | Flag to ignore entity processing.
[lexerIgnore] :: Lexer s -> Bool
-- | Flag to log errors.
[lexerLog] :: Lexer s -> Bool
-- | The offset in the data for the next word to read.
[lexerOffset] :: Lexer s -> STRef s Int
-- | The token buffer.
[lexerToken] :: Lexer s -> STRef s (TokenBuffer s)
-- | The buffer is used to accumulate characters during some types of
-- character processing.
[lexerBuffer] :: Lexer s -> STRef s (Buffer s)
-- | The last start tag name to have been emitted.
[lexerLast] :: Lexer s -> STRef s [Word8]
-- | The current lexer state in some cases.
[lexerState] :: Lexer s -> STRef s LexerState
-- | The state to return to after character reference processing.
[lexerReturn] :: Lexer s -> STRef s LexerState
-- | The skip next linefeed flag.
[lexerSkip] :: Lexer s -> STRef s LexerSkip
-- | The lexer errors.
[lexerErrors] :: Lexer s -> STRef s (DList BS)
-- | The character reference code.
[lexerCode] :: Lexer s -> STRef s Int
-- | Lexer options type.
data LexerOptions
LexerOptions :: BS -> Bool -> Bool -> LexerOptions
-- | The input to the lexer.
[lexerOptionInput] :: LexerOptions -> BS
-- | Indicates whether errors are logged.
[lexerOptionLogErrors] :: LexerOptions -> Bool
-- | Indicates that entities should not be tokenized.
[lexerOptionIgnoreEntities] :: LexerOptions -> Bool
-- | Defines the skip mode.
data LexerSkip
LexerSkipNone :: LexerSkip
LexerSkipLF :: LexerSkip
-- | Makes a new lexer.
lexerNew :: LexerOptions -> ST s (Either BS (Lexer s))
-- | Sets the RCDATA mode.
lexerSetRCDATA :: Lexer s -> ST s ()
-- | Sets the raw text mode.
lexerSetRAWTEXT :: Lexer s -> ST s ()
-- | Sets the plain text mode.
lexerSetPLAINTEXT :: Lexer s -> ST s ()
-- | Sets the script data mode.
lexerSetScriptData :: Lexer s -> ST s ()
-- | Sets the skip next linefeed flag.
lexerSkipNextLF :: Lexer s -> ST s ()
-- | Gets the next token from a lexer.
lexerNext :: Lexer s -> ST s Token
instance GHC.Classes.Ord Zenacy.HTML.Internal.Lexer.LexerState
instance GHC.Classes.Eq Zenacy.HTML.Internal.Lexer.LexerState
instance GHC.Show.Show Zenacy.HTML.Internal.Lexer.LexerState
instance GHC.Show.Show Zenacy.HTML.Internal.Lexer.LexerSkip
instance GHC.Classes.Ord Zenacy.HTML.Internal.Lexer.LexerSkip
instance GHC.Classes.Eq Zenacy.HTML.Internal.Lexer.LexerSkip
instance GHC.Show.Show Zenacy.HTML.Internal.Lexer.LexerOptions
instance Data.Default.Class.Default Zenacy.HTML.Internal.Lexer.LexerOptions
-- | Defines the HTML DOM types and functions.
module Zenacy.HTML.Internal.DOM
-- | DOM represents an HTML document while being parsed.
data DOM
DOM :: !DOMMap -> !DOMID -> DOM
[domNodes] :: DOM -> !DOMMap
[domNextID] :: DOM -> !DOMID
-- | Node is the model type for an HTML document.
data DOMNode
DOMDocument :: DOMID -> DOMID -> BS -> Seq DOMID -> DOMQuirks -> DOMNode
[domDocumentID] :: DOMNode -> DOMID
[domDocumentParent] :: DOMNode -> DOMID
[domDocumentName] :: DOMNode -> BS
[domDocumentChildren] :: DOMNode -> Seq DOMID
[domDocumentQuirksMode] :: DOMNode -> DOMQuirks
DOMDoctype :: DOMID -> DOMID -> BS -> Maybe BS -> Maybe BS -> DOMNode
[domDoctypeID] :: DOMNode -> DOMID
[domDoctypeParent] :: DOMNode -> DOMID
[domDoctypeName] :: DOMNode -> BS
[domDoctypePublicID] :: DOMNode -> Maybe BS
[domDoctypeSystemID] :: DOMNode -> Maybe BS
DOMFragment :: DOMID -> DOMID -> BS -> Seq DOMID -> DOMNode
[domFragmentID] :: DOMNode -> DOMID
[domFragmentParent] :: DOMNode -> DOMID
[domFragmentName] :: DOMNode -> BS
[domFragmentChildren] :: DOMNode -> Seq DOMID
DOMElement :: DOMID -> DOMID -> BS -> HTMLNamespace -> Seq DOMAttr -> Seq DOMID -> DOMNode
[domElementID] :: DOMNode -> DOMID
[domElementParent] :: DOMNode -> DOMID
[domElementName] :: DOMNode -> BS
[domElementNamespace] :: DOMNode -> HTMLNamespace
[domElementAttributes] :: DOMNode -> Seq DOMAttr
[domElementChildren] :: DOMNode -> Seq DOMID
DOMTemplate :: DOMID -> DOMID -> HTMLNamespace -> Seq DOMAttr -> DOMID -> DOMNode
[domTemplateID] :: DOMNode -> DOMID
[domTemplateParent] :: DOMNode -> DOMID
[domTemplateNamespace] :: DOMNode -> HTMLNamespace
[domTemplateAttributes] :: DOMNode -> Seq DOMAttr
[domTemplateContents] :: DOMNode -> DOMID
DOMText :: DOMID -> DOMID -> BS -> DOMNode
[domTextID] :: DOMNode -> DOMID
[domTextParent] :: DOMNode -> DOMID
[domTextData] :: DOMNode -> BS
DOMComment :: DOMID -> DOMID -> BS -> DOMNode
[domCommentID] :: DOMNode -> DOMID
[domCommentParent] :: DOMNode -> DOMID
[domCommentData] :: DOMNode -> BS
-- | An HTML element attribute type.
data DOMAttr
DOMAttr :: BS -> BS -> HTMLAttrNamespace -> DOMAttr
[domAttrName] :: DOMAttr -> BS
[domAttrVal] :: DOMAttr -> BS
[domAttrNamespace] :: DOMAttr -> HTMLAttrNamespace
-- | Identifies the type of an element.
data DOMType
DOMType :: BS -> HTMLNamespace -> DOMType
[domTypeName] :: DOMType -> BS
[domTypeNamespace] :: DOMType -> HTMLNamespace
-- | Indentifies the quirks mode.
data DOMQuirks
DOMQuirksNone :: DOMQuirks
DOMQuirksMode :: DOMQuirks
DOMQuirksLimited :: DOMQuirks
-- | Defines a position in the DOM.
data DOMPos
DOMPos :: DOMID -> Maybe DOMID -> DOMPos
[domPosParent] :: DOMPos -> DOMID
[domPosChild] :: DOMPos -> Maybe DOMID
-- | Defines an ID for a node in a document.
type DOMID = Int
-- | Defines a mapping between node references and nodes.
type DOMMap = IntMap DOMNode
-- | Makes an attribute.
domAttrMake :: BS -> BS -> DOMAttr
-- | Defines a default document.
domDefaultDocument :: DOMNode
-- | Defines a default document type.
domDefaultDoctype :: DOMNode
-- | Defines a default document fragment.
domDefaultFragment :: DOMNode
-- | Defines a default element.
domDefaultElement :: DOMNode
-- | Defines a default template.
domDefaultTemplate :: DOMNode
-- | Defines a default text.
domDefaultText :: DOMNode
-- | Defines a default comment.
domDefaultComment :: DOMNode
-- | Defines a default type.
domDefaultType :: DOMType
-- | Makes a new HTML element type.
domMakeTypeHTML :: BS -> DOMType
-- | Makes a new MathML element type.
domMakeTypeMathML :: BS -> DOMType
-- | Makes a new SVG element type.
domMakeTypeSVG :: BS -> DOMType
-- | Makes a new position.
domPos :: DOMID -> DOMPos
-- | The null node ID.
domNull :: DOMID
-- | The root document node ID.
domRoot :: DOMID
-- | Defines an appending position in a document node.
domRootPos :: DOMPos
-- | Gets the document node for a DOM.
domDocument :: DOM -> DOMNode
-- | Sets the quirks mode for a document.
domQuirksSet :: DOMQuirks -> DOM -> DOM
-- | Gets the quirks mode for a document.
domQuirksGet :: DOM -> DOMQuirks
-- | Adds a new node to a DOM.
domNewID :: DOM -> DOMNode -> (DOM, DOMID)
-- | Gets a node for a node ID.
domGetNode :: DOM -> DOMID -> Maybe DOMNode
-- | Updates a node in the DOM.
domPutNode :: DOMID -> DOMNode -> DOM -> DOM
-- | Inserts a node at a position.
domInsert :: DOMPos -> DOMID -> DOM -> DOM
-- | Inserts a node at a position.
domInsertNew :: DOMPos -> DOMNode -> DOM -> (DOM, DOMID)
-- | Appends a node ID to a node.
domAppend :: DOMID -> DOMID -> DOM -> DOM
-- | Appends a node to a node.
domAppendNew :: DOMID -> DOMNode -> DOM -> DOM
-- | Determines if a node has a named attribute.
domElementHasAttr :: DOMNode -> BS -> Bool
-- | Finds an attribute for an element.
domElementFindAttr :: DOMNode -> BS -> Maybe DOMAttr
-- | Finds an attribute value for an element.
domElementAttrValue :: DOMNode -> BS -> Maybe BS
-- | Merges attributes into an existing node.
domAttrMerge :: DOMID -> Seq DOMAttr -> DOM -> DOM
-- | Detmermines if two elements match.
domMatch :: DOM -> DOMID -> DOMID -> Bool
-- | Returns the last child of a node if it exists.
domLastChild :: DOM -> DOMID -> Maybe DOMID
-- | Converts a list of node IDs to nodes.
domMapID :: DOM -> [DOMID] -> [DOMNode]
-- | Finds the parent node for a node.
domFindParent :: DOM -> DOMID -> Maybe DOMID
-- | Sets the parent for a node.
domSetParent :: DOMID -> DOMID -> DOM -> DOM
-- | Maps a function over children of a node.
domMapChild :: DOMID -> (Seq DOMID -> Seq DOMID) -> DOM -> DOM
-- | Removes a child from a node.
domRemoveChild :: DOMID -> DOMID -> DOM -> DOM
-- | Removes all the children from a node.
domRemoveChildren :: DOMID -> DOM -> DOM
-- | Moves a node to another parent.
domMove :: DOMID -> DOMID -> DOM -> DOM
-- | Moves the children of a node to another node.
domMoveChildren :: DOMID -> DOMID -> DOM -> DOM
-- | Gets the children of a node.
domChildren :: DOM -> DOMID -> Seq DOMID
-- | Determines if a node has a specific child.
domHasChild :: DOM -> DOMID -> DOMID -> Bool
-- | Gets the id for a node.
domNodeID :: DOMNode -> DOMID
-- | Gets the parent for a node.
domNodeParent :: DOMNode -> DOMID
-- | Detmermines if a node is in the HTML namespace.
domNodeIsHTML :: DOMNode -> Bool
-- | Detmermines if a node is in the SVG namespace.
domNodeIsSVG :: DOMNode -> Bool
-- | Detmermines if a node is in the MathML namespace.
domNodeIsMathML :: DOMNode -> Bool
-- | Detmermines if a node is a document node.
domNodeIsDocument :: DOMNode -> Bool
-- | Detmermines if a node is a document fragment node.
domNodeIsFragment :: DOMNode -> Bool
-- | Detmermines if a node is an element node.
domNodeIsElement :: DOMNode -> Bool
-- | Detmermines if a node is a template node.
domNodeIsTemplate :: DOMNode -> Bool
-- | Detmermines if a node is an HTML element node.
domNodeIsHtmlElement :: DOMNode -> Bool
-- | Detmermines if a node is a text node.
domNodeIsText :: DOMNode -> Bool
-- | Gets the name for an element node.
domNodeElementName :: DOMNode -> BS
-- | Gets the name for an element node.
domNodeElementNamespace :: DOMNode -> HTMLNamespace
-- | Gets the type for an element node.
domNodeType :: DOMNode -> DOMType
-- | Gets a list of HTML types for element names.
domTypesHTML :: [BS] -> [DOMType]
-- | Gets a list of MathML types for element names.
domTypesMathML :: [BS] -> [DOMType]
-- | Gets a list of SVG types for element names.
domTypesSVG :: [BS] -> [DOMType]
-- | Renders the DOM.
domRender :: DOM -> BS
instance GHC.Show.Show Zenacy.HTML.Internal.DOM.DOMPos
instance GHC.Classes.Ord Zenacy.HTML.Internal.DOM.DOMPos
instance GHC.Classes.Eq Zenacy.HTML.Internal.DOM.DOMPos
instance GHC.Show.Show Zenacy.HTML.Internal.DOM.DOM
instance GHC.Classes.Ord Zenacy.HTML.Internal.DOM.DOM
instance GHC.Classes.Eq Zenacy.HTML.Internal.DOM.DOM
instance GHC.Show.Show Zenacy.HTML.Internal.DOM.DOMNode
instance GHC.Classes.Ord Zenacy.HTML.Internal.DOM.DOMNode
instance GHC.Classes.Eq Zenacy.HTML.Internal.DOM.DOMNode
instance GHC.Show.Show Zenacy.HTML.Internal.DOM.DOMQuirks
instance GHC.Classes.Ord Zenacy.HTML.Internal.DOM.DOMQuirks
instance GHC.Classes.Eq Zenacy.HTML.Internal.DOM.DOMQuirks
instance GHC.Show.Show Zenacy.HTML.Internal.DOM.DOMType
instance GHC.Classes.Ord Zenacy.HTML.Internal.DOM.DOMType
instance GHC.Classes.Eq Zenacy.HTML.Internal.DOM.DOMType
instance GHC.Show.Show Zenacy.HTML.Internal.DOM.DOMAttr
instance GHC.Classes.Ord Zenacy.HTML.Internal.DOM.DOMAttr
instance GHC.Classes.Eq Zenacy.HTML.Internal.DOM.DOMAttr
instance Data.Default.Class.Default Zenacy.HTML.Internal.DOM.DOM
instance Data.Default.Class.Default Zenacy.HTML.Internal.DOM.DOMAttr
-- | The HTML parser.
module Zenacy.HTML.Internal.Parser
-- | Parser processing state.
data Parser s
Parser :: STRef s (Lexer s) -> STRef s DOM -> STRef s [DOMID] -> STRef s [ParserFormatItem] -> STRef s ParserMode -> STRef s ParserMode -> STRef s [ParserMode] -> STRef s (Maybe DOMID) -> STRef s (Maybe DOMID) -> STRef s (Maybe DOMID) -> STRef s Bool -> STRef s Bool -> STRef s Bool -> STRef s Bool -> STRef s Bool -> STRef s [Token] -> STRef s (ParserAdoptionAgency s) -> STRef s (DList BS) -> STRef s Bool -> STRef s (IntMap (STRef s (Buffer s))) -> Bool -> Parser s
-- | The lexer for token generation.
[parserLexer] :: Parser s -> STRef s (Lexer s)
-- | The parser DOM.
[parserDOM] :: Parser s -> STRef s DOM
-- | The element stack (section 12.2.3.2).
[parserElementStack] :: Parser s -> STRef s [DOMID]
-- | The list of action formatting elements (section 12.2.3.3).
[parserActiveFormatList] :: Parser s -> STRef s [ParserFormatItem]
-- | The current insertion mode.
[parserInsertionMode] :: Parser s -> STRef s ParserMode
-- | The original insertion mode.
[parserOriginalMode] :: Parser s -> STRef s ParserMode
-- | The template insertion mode.
[parserTemplateMode] :: Parser s -> STRef s [ParserMode]
-- | The context element.
[parserContextElement] :: Parser s -> STRef s (Maybe DOMID)
-- | The head element pointer (section 12.2.3.4).
[parserHeadElement] :: Parser s -> STRef s (Maybe DOMID)
-- | The form element pointer (section 12.2.3.4).
[parserFormElement] :: Parser s -> STRef s (Maybe DOMID)
-- | The self closing acknowledges flag.
[parserSelfClosingFlag] :: Parser s -> STRef s Bool
-- | The flag indicating parser is in fragment mode.
[parserFragmentMode] :: Parser s -> STRef s Bool
-- | The foster parenting flag.
[parserFosterParenting] :: Parser s -> STRef s Bool
-- | The frame-set ok flag (section 12.2.3.5).
[parserFrameSetOK] :: Parser s -> STRef s Bool
-- | The parser done flag.
[parserDone] :: Parser s -> STRef s Bool
-- | The pending table characters.
[parserTableChars] :: Parser s -> STRef s [Token]
-- | The adoption agency state.
[parserAdoptionAgency] :: Parser s -> STRef s (ParserAdoptionAgency s)
-- | The parser errors.
[parserErrors] :: Parser s -> STRef s (DList BS)
-- | Indicates that the documnet is an iframe srcdoc.
[parserIFrameSrcDoc] :: Parser s -> STRef s Bool
-- | Map of buffers for holding dom strings.
[parserTextMap] :: Parser s -> STRef s (IntMap (STRef s (Buffer s)))
-- | Flag to log errors.
[parserLogErrors] :: Parser s -> Bool
-- | Parser options type.
data ParserOptions
ParserOptions :: BS -> Bool -> Bool -> ParserOptions
-- | The input to the lexer.
[parserOptionInput] :: ParserOptions -> BS
-- | Indicates whether warnings are logged.
[parserOptionLogErrors] :: ParserOptions -> Bool
-- | Indicates that entities should not be tokenized.
[parserOptionIgnoreEntities] :: ParserOptions -> Bool
-- | Parser result type.
data ParserResult
ParserResult :: DOM -> [BS] -> ParserResult
[parserResultDOM] :: ParserResult -> DOM
[parserResultErrors] :: ParserResult -> [BS]
-- | Parses an HTML document.
parseDocument :: ParserOptions -> Either BS ParserResult
-- | Parses an HTML fragment.
parseFragment :: ParserOptions -> Either BS ParserResult
instance GHC.Show.Show Zenacy.HTML.Internal.Parser.ElementDetails
instance GHC.Classes.Ord Zenacy.HTML.Internal.Parser.ElementDetails
instance GHC.Classes.Eq Zenacy.HTML.Internal.Parser.ElementDetails
instance GHC.Show.Show Zenacy.HTML.Internal.Parser.ParserElementCategory
instance GHC.Classes.Ord Zenacy.HTML.Internal.Parser.ParserElementCategory
instance GHC.Classes.Eq Zenacy.HTML.Internal.Parser.ParserElementCategory
instance GHC.Show.Show Zenacy.HTML.Internal.Parser.ParserFormatItem
instance GHC.Classes.Ord Zenacy.HTML.Internal.Parser.ParserFormatItem
instance GHC.Classes.Eq Zenacy.HTML.Internal.Parser.ParserFormatItem
instance GHC.Show.Show Zenacy.HTML.Internal.Parser.ParserResult
instance GHC.Classes.Ord Zenacy.HTML.Internal.Parser.ParserResult
instance GHC.Classes.Eq Zenacy.HTML.Internal.Parser.ParserResult
instance GHC.Show.Show Zenacy.HTML.Internal.Parser.ParserOptions
instance GHC.Classes.Ord Zenacy.HTML.Internal.Parser.ParserOptions
instance GHC.Classes.Eq Zenacy.HTML.Internal.Parser.ParserOptions
instance GHC.Show.Show Zenacy.HTML.Internal.Parser.ParserMode
instance GHC.Classes.Ord Zenacy.HTML.Internal.Parser.ParserMode
instance GHC.Classes.Eq Zenacy.HTML.Internal.Parser.ParserMode
instance Data.Default.Class.Default Zenacy.HTML.Internal.Parser.ParserResult
instance Data.Default.Class.Default Zenacy.HTML.Internal.Parser.ParserOptions
-- | Defines the top-level HTML types and parser functions.
module Zenacy.HTML.Internal.HTML
-- | Defines options for the HTML parser.
data HTMLOptions
HTMLOptions :: !Bool -> !Bool -> HTMLOptions
-- | Indicates that errors should be logged.
[htmlOptionLogErrors] :: HTMLOptions -> !Bool
-- | Indicates that entities should not be decoded.
[htmlOptionIgnoreEntities] :: HTMLOptions -> !Bool
-- | Defines an HTML parser result.
data HTMLResult
HTMLResult :: !HTMLNode -> ![HTMLError] -> HTMLResult
-- | The parsed document structure.
[htmlResultDocument] :: HTMLResult -> !HTMLNode
-- | The errors logged while parsing if error logging was enabled.
[htmlResultErrors] :: HTMLResult -> ![HTMLError]
-- | An HTML error type.
data HTMLError
HTMLError :: !Text -> HTMLError
-- | The error message.
[htmlErrorText] :: HTMLError -> !Text
-- | Defines the model type for an HTML document.
data HTMLNode
HTMLDocument :: !Text -> ![HTMLNode] -> HTMLNode
-- | The document name.
[htmlDocumentName] :: HTMLNode -> !Text
-- | The document children.
[htmlDocumentChildren] :: HTMLNode -> ![HTMLNode]
HTMLDoctype :: !Text -> !Maybe Text -> !Maybe Text -> HTMLNode
-- | The DOCTYPE name.
[htmlDoctypeName] :: HTMLNode -> !Text
-- | The public ID.
[htmlDoctypePublicID] :: HTMLNode -> !Maybe Text
-- | The system ID.
[htmlDoctypeSystemID] :: HTMLNode -> !Maybe Text
HTMLFragment :: !Text -> ![HTMLNode] -> HTMLNode
-- | The fragment name.
[htmlFragmentName] :: HTMLNode -> !Text
-- | The fragment children.
[htmlFragmentChildren] :: HTMLNode -> ![HTMLNode]
HTMLElement :: !Text -> !HTMLNamespace -> ![HTMLAttr] -> ![HTMLNode] -> HTMLNode
-- | The element name.
[htmlElementName] :: HTMLNode -> !Text
-- | The element namespace.
[htmlElementNamespace] :: HTMLNode -> !HTMLNamespace
-- | The element attributes.
[htmlElementAttributes] :: HTMLNode -> ![HTMLAttr]
-- | The element children.
[htmlElementChildren] :: HTMLNode -> ![HTMLNode]
HTMLTemplate :: !HTMLNamespace -> ![HTMLAttr] -> !HTMLNode -> HTMLNode
-- | The template namespace.
[htmlTemplateNamespace] :: HTMLNode -> !HTMLNamespace
-- | The template attributes.
[htmlTemplateAttributes] :: HTMLNode -> ![HTMLAttr]
-- | The template contents.
[htmlTemplateContents] :: HTMLNode -> !HTMLNode
HTMLText :: !Text -> HTMLNode
-- | The text value.
[htmlTextData] :: HTMLNode -> !Text
HTMLComment :: !Text -> HTMLNode
-- | The comment text.
[htmlCommentData] :: HTMLNode -> !Text
-- | An HTML element attribute type.
data HTMLAttr
HTMLAttr :: Text -> Text -> HTMLAttrNamespace -> HTMLAttr
[htmlAttrName] :: HTMLAttr -> Text
[htmlAttrVal] :: HTMLAttr -> Text
[htmlAttrNamespace] :: HTMLAttr -> HTMLAttrNamespace
-- | An HTML namespace type.
data HTMLNamespace
HTMLNamespaceHTML :: HTMLNamespace
HTMLNamespaceSVG :: HTMLNamespace
HTMLNamespaceMathML :: HTMLNamespace
-- | An HTML attribute namespace type.
data HTMLAttrNamespace
HTMLAttrNamespaceNone :: HTMLAttrNamespace
HTMLAttrNamespaceXLink :: HTMLAttrNamespace
HTMLAttrNamespaceXML :: HTMLAttrNamespace
HTMLAttrNamespaceXMLNS :: HTMLAttrNamespace
-- | Parses an HTML document.
htmlParse :: HTMLOptions -> Text -> Either HTMLError HTMLResult
-- | Parses an HTML document the easy way.
htmlParseEasy :: Text -> HTMLNode
-- | Parses an HTML fragment.
htmlFragment :: HTMLOptions -> Text -> Either HTMLError HTMLResult
-- | Defines a default document.
htmlDefaultDocument :: HTMLNode
-- | Defines a default document type.
htmlDefaultDoctype :: HTMLNode
-- | Defines a default document fragment.
htmlDefaultFragment :: HTMLNode
-- | Defines a default element.
htmlDefaultElement :: HTMLNode
-- | Defines a default template.
htmlDefaultTemplate :: HTMLNode
-- | Defines a default text.
htmlDefaultText :: HTMLNode
-- | Defines a default comment.
htmlDefaultComment :: HTMLNode
-- | Makes an attribute.
htmlAttr :: Text -> Text -> HTMLAttr
-- | Makes an element.
htmlElem :: Text -> [HTMLAttr] -> [HTMLNode] -> HTMLNode
-- | Makes a text node.
htmlText :: Text -> HTMLNode
instance GHC.Show.Show Zenacy.HTML.Internal.HTML.HTMLResult
instance GHC.Classes.Ord Zenacy.HTML.Internal.HTML.HTMLResult
instance GHC.Classes.Eq Zenacy.HTML.Internal.HTML.HTMLResult
instance GHC.Show.Show Zenacy.HTML.Internal.HTML.HTMLNode
instance GHC.Classes.Ord Zenacy.HTML.Internal.HTML.HTMLNode
instance GHC.Classes.Eq Zenacy.HTML.Internal.HTML.HTMLNode
instance GHC.Show.Show Zenacy.HTML.Internal.HTML.HTMLAttr
instance GHC.Classes.Ord Zenacy.HTML.Internal.HTML.HTMLAttr
instance GHC.Classes.Eq Zenacy.HTML.Internal.HTML.HTMLAttr
instance GHC.Classes.Ord Zenacy.HTML.Internal.HTML.HTMLError
instance GHC.Classes.Eq Zenacy.HTML.Internal.HTML.HTMLError
instance GHC.Show.Show Zenacy.HTML.Internal.HTML.HTMLError
instance GHC.Show.Show Zenacy.HTML.Internal.HTML.HTMLOptions
instance GHC.Classes.Ord Zenacy.HTML.Internal.HTML.HTMLOptions
instance GHC.Classes.Eq Zenacy.HTML.Internal.HTML.HTMLOptions
instance Data.Default.Class.Default Zenacy.HTML.Internal.HTML.HTMLResult
instance Data.Default.Class.Default Zenacy.HTML.Internal.HTML.HTMLAttr
instance Data.Default.Class.Default Zenacy.HTML.Internal.HTML.HTMLError
instance Data.Default.Class.Default Zenacy.HTML.Internal.HTML.HTMLOptions
-- | Defines operations on html data types.
module Zenacy.HTML.Internal.Oper
-- | Determines if a node is an element node.
htmlNodeIsElem :: HTMLNode -> Bool
-- | Determines if a node is a text node.
htmlNodeIsText :: HTMLNode -> Bool
-- | Gets the content of a node.
htmlNodeContent :: HTMLNode -> [HTMLNode]
-- | Sets the content of a node.
htmlNodeContentSet :: [HTMLNode] -> HTMLNode -> HTMLNode
-- | Shows the node without its content.
htmlNodeShow :: HTMLNode -> String
-- | Finds a child node using a predicate.
htmlNodeFind :: (HTMLNode -> Bool) -> HTMLNode -> Maybe HTMLNode
-- | Counts the number of nodes matching a predicate.
htmlNodeCount :: (HTMLNode -> Bool) -> HTMLNode -> Int
-- | Counts the number of nodes matching a predicate.
htmlNodeCountM :: Monad m => (HTMLNode -> m Bool) -> HTMLNode -> m Int
-- | Determines if a node is a text node containing only whitespace.
htmlTextSpace :: HTMLNode -> Bool
-- | Appends text to a text node.
htmlTextAppend :: Text -> HTMLNode -> HTMLNode
-- | Prepends text to a text node.
htmlTextPrepend :: Text -> HTMLNode -> HTMLNode
-- | A predicate for checking attribute names.
htmlAttrHasName :: Text -> HTMLAttr -> Bool
-- | Renames an attribute.
htmlAttrRename :: Text -> HTMLAttr -> HTMLAttr
-- | Gets the attributes for an element.
htmlElemAttr :: HTMLNode -> [HTMLAttr]
-- | Gets the number of attributes for an element.
htmlElemAttrCount :: HTMLNode -> Int
-- | Finds an attribute for an element.
htmlElemAttrFind :: (HTMLAttr -> Bool) -> HTMLNode -> Maybe HTMLAttr
-- | Finds an attribute by name for an element.
htmlElemAttrFindName :: Text -> HTMLNode -> Maybe HTMLAttr
-- | Applies a function to the attributes for an element.
htmlElemAttrApply :: ([HTMLAttr] -> [HTMLAttr]) -> HTMLNode -> HTMLNode
-- | Filters the attributes for an element.
htmlElemAttrFilter :: (HTMLAttr -> Bool) -> HTMLNode -> HTMLNode
-- | Maps an endofunctor over an element attributes.
htmlElemAttrMap :: (HTMLAttr -> HTMLAttr) -> HTMLNode -> HTMLNode
-- | Determines if the element has attributes.
htmlElemHasAttr :: HTMLNode -> Bool
-- | Determines if an element has an attribute.
htmlElemHasAttrName :: Text -> HTMLNode -> Bool
-- | Determines if an element has an attribute value.
htmlElemHasAttrVal :: Text -> Text -> HTMLNode -> Bool
-- | Determines if an element has part of an attribute value.
htmlElemHasAttrValInfix :: Text -> Text -> HTMLNode -> Bool
-- | Adds an attribute to an element.
htmlElemAddAttr :: HTMLAttr -> HTMLNode -> HTMLNode
-- | Sets an attribute value.
htmlElemSetAttr :: Text -> Text -> HTMLNode -> HTMLNode
-- | Gets an attribute value.
htmlElemGetAttr :: Text -> HTMLNode -> Maybe Text
-- | Removes an attribute from an element.
htmlElemAttrRemove :: Text -> HTMLNode -> HTMLNode
-- | Removes all attributes from an element.
htmlElemRemoveAllAttr :: HTMLNode -> HTMLNode
-- | Renames an attribute for an element.
htmlElemAttrRename :: Text -> Text -> HTMLNode -> HTMLNode
-- | Gets the id attribute for an element.
htmlElemID :: HTMLNode -> Maybe Text
-- | Sets the id attribute for an element.
htmlElemIDSet :: Text -> HTMLNode -> HTMLNode
-- | Determines if an element has an id.
htmlElemHasID :: Text -> HTMLNode -> Bool
-- | Searches for an element with an id.
htmlElemFindID :: Text -> HTMLNode -> Maybe HTMLNode
-- | Gets the id attribute for an element.
htmlElemClass :: HTMLNode -> Maybe Text
-- | Sets the class attribute for an element.
htmlElemClassSet :: Text -> HTMLNode -> HTMLNode
-- | Gets the element classes.
htmlElemClasses :: HTMLNode -> Set Text
-- | Sets the element classes.
htmlElemClassesSet :: Set Text -> HTMLNode -> HTMLNode
-- | Adds the class to the element's classes.
htmlElemClassesAdd :: Text -> HTMLNode -> HTMLNode
-- | Removes a class from the element's classes.
htmlElemClassesRemove :: Text -> HTMLNode -> HTMLNode
-- | Determines if the element contains a class.
htmlElemClassesContains :: Text -> HTMLNode -> Bool
-- | Gets the style attribute for an element.
htmlElemStyle :: HTMLNode -> Maybe Text
-- | Gets the styles for an element.
htmlElemStyles :: HTMLNode -> Map Text Text
-- | Parses and returns a url style value.
htmlElemStyleParseURL :: Text -> Maybe Text
-- | Gets the children for the element if the node is an element.
htmlElemContent :: HTMLNode -> [HTMLNode]
-- | Sets the content for an element.
htmlElemContentSet :: [HTMLNode] -> HTMLNode -> HTMLNode
-- | Determines if the element has children.
htmlElemHasContent :: HTMLNode -> Bool
-- | Gets the first child for an element.
htmlElemNodeFirst :: HTMLNode -> Maybe HTMLNode
-- | Gets the last child for an element.
htmlElemNodeLast :: HTMLNode -> Maybe HTMLNode
-- | Gets the number of children for an element.
htmlElemNodeCount :: HTMLNode -> Int
-- | Gets the name of an element.
htmlElemName :: HTMLNode -> Text
-- | Checks if the name of an element matches a specified name.
htmlElemHasName :: Text -> HTMLNode -> Bool
-- | Sets the name of an element.
htmlElemRename :: Text -> HTMLNode -> HTMLNode
-- | Finds a child element using a predicate.
htmlElemFindElem :: (HTMLNode -> Bool) -> HTMLNode -> Maybe HTMLNode
-- | Finds a child element with a specified name.
htmlElemFindElemNamed :: Text -> HTMLNode -> Maybe HTMLNode
-- | Determines if an element has a child.
htmlElemHasElem :: (HTMLNode -> Bool) -> HTMLNode -> Bool
-- | Determines if an element has a child.
htmlElemHasElemNamed :: Text -> HTMLNode -> Bool
-- | Modifies an elements children by applying a function.
htmlElemContentApply :: ([HTMLNode] -> [HTMLNode]) -> HTMLNode -> HTMLNode
-- | Modifies an elements children by mapping a function over them.
htmlElemContentMap :: (HTMLNode -> HTMLNode) -> HTMLNode -> HTMLNode
-- | Modifies an elements children by filtering them.
htmlElemContentFilter :: (HTMLNode -> Bool) -> HTMLNode -> HTMLNode
-- | Finds an element using a depth-first search.
htmlElemSearch :: (HTMLNode -> Bool) -> HTMLNode -> Maybe HTMLNode
-- | Gets the text content for an element.
htmlElemText :: HTMLNode -> Maybe Text
-- | Finds the html element given a document.
htmlDocHtml :: HTMLNode -> Maybe HTMLNode
-- | Finds the body element given a document.
htmlDocBody :: HTMLNode -> Maybe HTMLNode
-- | Finds the head element given a document.
htmlDocHead :: HTMLNode -> Maybe HTMLNode
-- | Finds the title for a document.
htmlDocTitle :: HTMLNode -> Maybe Text
-- | Maps a function over all the elements defined by a node.
htmlMapElem :: (HTMLNode -> HTMLNode) -> HTMLNode -> HTMLNode
-- | Maps a function over all the elements defined by a node.
htmlMapElemM :: Monad m => (HTMLNode -> m HTMLNode) -> HTMLNode -> m HTMLNode
-- | Collapses a tree of elements based on a predicate.
htmlElemCollapse :: (HTMLNode -> Bool) -> HTMLNode -> [HTMLNode]
-- | Collapses a tree of elements based on a predicate.
htmlElemCollapseM :: Monad m => (HTMLNode -> m Bool) -> HTMLNode -> m [HTMLNode]
-- | Defines the HTML render.
module Zenacy.HTML.Internal.Render
-- | Prints an HTML document.
htmlPrint :: HTMLNode -> IO ()
-- | Pretty prints an HTML document.
htmlPrintPretty :: HTMLNode -> IO ()
-- | Renders an HTML document.
htmlRender :: HTMLNode -> Text
-- | Renders the contents of a node
htmlRenderContent :: HTMLNode -> Text
-- | Renders a list of nodes.
htmlRenderNodes :: [HTMLNode] -> Text
-- | Renders an HTML document using pretty printing.
htmlRenderPretty :: HTMLNode -> Text
instance GHC.Classes.Ord Zenacy.HTML.Internal.Render.HTMLRenderMode
instance GHC.Classes.Eq Zenacy.HTML.Internal.Render.HTMLRenderMode
instance GHC.Show.Show Zenacy.HTML.Internal.Render.HTMLRenderMode
-- | Filters and transforms for HTML trees.
module Zenacy.HTML.Internal.Filter
-- | Removes whitespace and comments from an HTML structure. Document
-- elements are not accepted, and only non-empty text nodes and element
-- nodes are kept. pre, code, samp, and
-- kdb elements are passed without modification, since
-- whitespace is typically significant in those elements.
htmlSpaceRemove :: HTMLNode -> Maybe HTMLNode
-- | Defines types for zipping and iterating over HTML trees.
module Zenacy.HTML.Internal.Zip
-- | The zipper type.
data HTMLZipper
-- | Defines an action on a zipper.
type HTMLZipAction = HTMLZipper -> Maybe HTMLZipper
-- | The zipper iterator type.
data HTMLIter
-- | Defines the type for a path.
newtype HTMLZipPath
HTMLZipPath :: [Int] -> HTMLZipPath
-- | Creates a zipper for a HTML node.
htmlZip :: HTMLNode -> HTMLZipper
-- | Creates a zipper for a HTML node in a Monad.
htmlZipM :: Monad m => HTMLNode -> m HTMLZipper
-- | Extracts the HTML node from a zipper.
htmlUnzip :: HTMLZipper -> HTMLNode
-- | Extracts the HTML node from a zipper in a Monad.
htmlUnzipM :: Monad m => HTMLZipper -> m HTMLNode
-- | Gets the current HTML node.
htmlZipNode :: HTMLZipper -> HTMLNode
-- | Gets the current HTML node in a Monad.
htmlZipNodeM :: Monad m => HTMLZipper -> m HTMLNode
-- | Moves the zipper to the root HTML node.
htmlZipRoot :: HTMLZipper -> HTMLZipper
-- | Moves the zipper to the root HTML node in a Monad.
htmlZipRootM :: Monad m => HTMLZipper -> m HTMLZipper
-- | Moves the zipper to the parent node.
htmlZipUp :: HTMLZipper -> Maybe HTMLZipper
-- | Moves the zipper to the parent node.
htmlZipParent :: HTMLZipper -> Maybe HTMLZipper
-- | Moves the zipper to the first child node.
htmlZipFirst :: HTMLZipper -> Maybe HTMLZipper
-- | Moves the zipper to the last child node.
htmlZipLast :: HTMLZipper -> Maybe HTMLZipper
-- | Moves the zipper to a named child element.
htmlZipFind :: (HTMLNode -> Bool) -> HTMLZipper -> Maybe HTMLZipper
-- | Moves to the next sibling.
htmlZipNext :: HTMLZipper -> Maybe HTMLZipper
-- | Moves to the previous sibling.
htmlZipPrev :: HTMLZipper -> Maybe HTMLZipper
-- | Gets the child specified by an index.
htmlZipGet :: Int -> HTMLZipper -> Maybe HTMLZipper
-- | Continues a zipper if a test is passed.
htmlZipTest :: (HTMLZipper -> Bool) -> HTMLZipper -> Maybe HTMLZipper
-- | Continues a zipper if a node test is passed.
htmlZipTestNode :: (HTMLNode -> Bool) -> HTMLZipper -> Maybe HTMLZipper
-- | Tests the current node for an element name.
htmlZipTestName :: Text -> HTMLZipper -> Maybe HTMLZipper
-- | Test whether the zipper is at the first child node.
htmlZipTestFirst :: HTMLZipper -> Maybe HTMLZipper
-- | Test whether the zipper is at the last child node.
htmlZipTestLast :: HTMLZipper -> Maybe HTMLZipper
-- | Modifies the currently focused node.
htmlZipModify :: (HTMLNode -> HTMLNode) -> HTMLZipper -> HTMLZipper
-- | Modifies the currently focused node in a Monad.
htmlZipModifyM :: Monad m => (HTMLNode -> HTMLNode) -> HTMLZipper -> m HTMLZipper
-- | Deletes the current node.
htmlZipDelete :: HTMLZipper -> Maybe HTMLZipper
-- | Collapses the current node.
htmlZipCollapse :: HTMLZipper -> Maybe HTMLZipper
-- | Inserts a node before the current node.
htmlZipInsertBefore :: HTMLNode -> HTMLZipper -> Maybe HTMLZipper
-- | Inserts a node after the current node.
htmlZipInsertAfter :: HTMLNode -> HTMLZipper -> Maybe HTMLZipper
-- | Gets the siblings to the left of the current node.
htmlZipContentBefore :: HTMLZipper -> [HTMLNode]
-- | Gets the siblings to the right of the current node.
htmlZipContentAfter :: HTMLZipper -> [HTMLNode]
-- | Synonym for htmlZipContentBefore.
htmlZipContentLeft :: HTMLZipper -> [HTMLNode]
-- | Synonym for htmlZipContentAfter.
htmlZipContentRight :: HTMLZipper -> [HTMLNode]
-- | Drops the siblings to the left of the current node.
htmlZipDropBefore :: HTMLZipper -> Maybe HTMLZipper
-- | Drops the siblings to the right of the current node.
htmlZipDropAfter :: HTMLZipper -> Maybe HTMLZipper
-- | Synonym for htmlZipDropBefore.
htmlZipDropLeft :: HTMLZipper -> Maybe HTMLZipper
-- | Synonym for htmlZipDropAfter.
htmlZipDropRight :: HTMLZipper -> Maybe HTMLZipper
-- | Drops all of the branches to the left of the current node while moving
-- up to and ending at the root.
htmlZipPruneBefore :: HTMLZipper -> Maybe HTMLZipper
-- | Drops all of the branches to the right of the current node while
-- moving up to and ending at the root.
htmlZipPruneAfter :: HTMLZipper -> Maybe HTMLZipper
-- | Synonym for htmlZipPruneBefore.
htmlZipPruneLeft :: HTMLZipper -> Maybe HTMLZipper
-- | Synonym for htmlZipPruneAfter.
htmlZipPruneRight :: HTMLZipper -> Maybe HTMLZipper
-- | Repeats a zipper action until another zipper returns Nothing.
htmlZipRepeat :: HTMLZipAction -> HTMLZipAction -> HTMLZipAction
-- | Step a zipper forward one node.
htmlZipStepNext :: HTMLZipper -> Maybe HTMLZipper
-- | Step a zipper back one node.
htmlZipStepBack :: HTMLZipper -> Maybe HTMLZipper
-- | Searches a zipper until a predicate is true.
htmlZipSearch :: (HTMLZipper -> Maybe HTMLZipper) -> (HTMLZipper -> Bool) -> HTMLZipper -> Maybe HTMLZipper
-- | Gets the index for a node.
htmlZipIndex :: HTMLZipper -> Maybe Int
-- | Returns an iterator for a zipper.
htmlIter :: HTMLZipper -> HTMLIter
-- | Gets the iterator for a zipper.
htmlIterZipper :: HTMLIter -> HTMLZipper
-- | Searches an iterator until a predicate is true.
htmlIterSearch :: (HTMLIter -> Maybe HTMLIter) -> (HTMLZipper -> Bool) -> HTMLIter -> Maybe HTMLIter
-- | Modifies the zipper for an interator.
htmlIterModify :: (HTMLZipper -> HTMLZipper) -> HTMLIter -> HTMLIter
-- | Advances an iterator to the next element.
htmlIterNext :: HTMLIter -> Maybe HTMLIter
-- | Advances an iterator to the previous element.
htmlIterBack :: HTMLIter -> Maybe HTMLIter
-- | Gets the path for a node.
htmlZipPath :: HTMLZipper -> HTMLZipPath
-- | Defines an empty path.
htmlZipPathEmpty :: HTMLZipPath
-- | Finds the zipper for a path starting from the current node.
htmlZipPathFind :: HTMLZipPath -> HTMLZipper -> Maybe HTMLZipper
instance GHC.Classes.Ord Zenacy.HTML.Internal.Zip.HTMLZipPath
instance GHC.Classes.Eq Zenacy.HTML.Internal.Zip.HTMLZipPath
instance GHC.Show.Show Zenacy.HTML.Internal.Zip.HTMLZipPath
instance Data.Default.Class.Default Zenacy.HTML.Internal.Zip.HTMLZipPath
-- | A basic query facility.
module Zenacy.HTML.Internal.Query
-- | Defines the type for a query.
data HTMLQuery a
-- | Runs a query and returns a result.
htmlQueryRun :: HTMLNode -> HTMLQuery a -> Maybe a
-- | Same as run with the arguments flipped.
htmlQueryExec :: HTMLQuery a -> HTMLNode -> Maybe a
-- | Same as run with the arguments flipped.
htmlQueryTry :: HTMLQuery HTMLNode -> HTMLNode -> HTMLNode
-- | Returns a result that stops the query.
htmlQueryStop :: HTMLQuery a
-- | Returns a result that continues the query.
htmlQueryCont :: HTMLQuery ()
-- | Returns a successful query result.
htmlQuerySucc :: a -> HTMLQuery a
-- | Gets the current query zipper.
htmlQueryZipper :: HTMLQuery HTMLZipper
-- | Gets the current query node.
htmlQueryNode :: HTMLQuery HTMLNode
-- | Moves the query to the first child node.
htmlQueryFirst :: HTMLQuery ()
-- | Moves the query to the last child node.
htmlQueryLast :: HTMLQuery ()
-- | Moves the query to the next sibling node.
htmlQueryNext :: HTMLQuery ()
-- | Moves the query to the previous sibling node.
htmlQueryPrev :: HTMLQuery ()
-- | Moves the query to the parent node.
htmlQueryUp :: HTMLQuery ()
-- | Evaluates a test result and continues the query if true.
htmlQueryTest :: Bool -> HTMLQuery ()
-- | Tests the current element name.
htmlQueryName :: Text -> HTMLQuery ()
-- | Tests the current node to see if it is the first sibling.
htmlQueryIsFirst :: HTMLQuery ()
-- | Tests the current node to see if it is the last sibling.
htmlQueryIsLast :: HTMLQuery ()
-- | Saves the current query state.
htmlQuerySave :: Int -> HTMLQuery ()
-- | Gets a saved query node.
htmlQueryGet :: Int -> HTMLQuery HTMLNode
-- | Gets a saved query zipper.
htmlQueryGetZipper :: Int -> HTMLQuery HTMLZipper
-- | Gets the source input node.
htmlQuerySrc :: HTMLQuery HTMLNode
-- | Tests if the current node has an attribute.
htmlQueryAttr :: Text -> HTMLQuery ()
-- | Tests if the current node has an attribute value.
htmlQueryAttrVal :: Text -> Text -> HTMLQuery ()
-- | Tests if the current node has an id.
htmlQueryId :: Text -> HTMLQuery ()
-- | Tests if the current node has a class.
htmlQueryHasClass :: Text -> HTMLQuery ()
-- | Moves to the child and require that it is the only child.
htmlQueryOnly :: Text -> HTMLQuery ()
instance Control.Monad.State.Class.MonadState Zenacy.HTML.Internal.Query.QueryState Zenacy.HTML.Internal.Query.HTMLQuery
instance GHC.Base.Monad Zenacy.HTML.Internal.Query.HTMLQuery
instance GHC.Base.Applicative Zenacy.HTML.Internal.Query.HTMLQuery
instance GHC.Base.Functor Zenacy.HTML.Internal.Query.HTMLQuery
-- | Zenacy HTML is an HTML parsing and processing library that implements
-- the WHATWG HTML parsing standard. The standard is described as a state
-- machine that this library implements exactly as spelled out including
-- all the error handling, recovery, and conformance checks that makes it
-- robust in handling any HTML pulled from the web. In addition to
-- parsing, the library provides many processing features to help extract
-- information from web pages or rewrite them and render the modified
-- results.
module Zenacy.HTML