module Data.GI.GIR.Documentation
( Documentation(..)
, queryDocumentation
) where
import Data.Text (Text)
import Text.XML (Element)
import Data.GI.GIR.XMLUtils (firstChildWithLocalName, getElementContent,
lookupAttr)
data Documentation = Documentation { rawDocText :: Maybe Text
, sinceVersion :: Maybe Text
} deriving (Show, Eq, Ord)
queryDocumentation :: Element -> Documentation
queryDocumentation element = Documentation {
rawDocText = firstChildWithLocalName "doc" element >>= getElementContent,
sinceVersion = lookupAttr "version" element
}