-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A parser and writer for org-mode flavored documents. -- -- `orgmode-parse` is a parsing and writing library for the org-mode -- flavor of document markup. -- -- This library parses the human-readable and textual representation into -- an AST that can be used for output to another format (HTML? -- Markdown?), binary serialized for storage, etc... @package orgmode-parse @version 0.0.1.1 -- | Parsing combinators for org-mode entry property drawers. module Data.OrgMode.Parse.Attoparsec.PropertyDrawer data Heading Heading :: Int -> Maybe Priority -> Maybe State -> Text -> [Keyword] -> Heading level :: Heading -> Int priority :: Heading -> Maybe Priority state :: Heading -> Maybe State title :: Heading -> Text keywords :: Heading -> [Keyword] data Priority A :: Priority B :: Priority C :: Priority Unknown :: Priority newtype State State :: Text -> State newtype Keyword Keyword :: Text -> Keyword newtype PropertyDrawer k v PropertyDrawer :: (HashMap k v) -> PropertyDrawer k v toPriority :: Text -> Priority -- | Parse a property drawer. -- --
-- :PROPERTIES: -- :DATE: [2014-12-14 11:00] -- :NOTE: Something really crazy happened today! -- :END: --drawer :: Parser Text (PropertyDrawer Text Text) -- | Parse a property of a drawer. -- -- Properties *must* be a `:KEY: value` pair, the key can be of any case -- and contain any characters except for newlines and colons (since they -- delimit the start and end of the key). property :: Parser Text (Text, Text) -- | Parsing combinators for org-list headings. module Data.OrgMode.Parse.Attoparsec.Headings data Heading Heading :: Int -> Maybe Priority -> Maybe State -> Text -> [Keyword] -> Heading level :: Heading -> Int priority :: Heading -> Maybe Priority state :: Heading -> Maybe State title :: Heading -> Text keywords :: Heading -> [Keyword] data Priority A :: Priority B :: Priority C :: Priority Unknown :: Priority newtype State State :: Text -> State newtype Keyword Keyword :: Text -> Keyword newtype PropertyDrawer k v PropertyDrawer :: (HashMap k v) -> PropertyDrawer k v toPriority :: Text -> Priority -- | Parse an org-mode heading. heading :: Parser Text Heading -- | Parse the asterisk indicated heading level until a space is reached. headingLevel :: Parser Text Int -- | Parse the priority indicator. -- -- If anything but these priority indicators are used the parser will -- fail: `[B]`, `[#C]`. headingPriority :: Parser Text (Maybe Priority) -- | Title parser with alternative. -- -- This function tries to parse a title with a keyword and if it fails it -- then attempts to parse everything till the end of the line. headingTitle :: Parser Text (Text, Maybe Keyword) -- | Parse a heading keyword. -- -- You can use this with many' and catMaybes to get a list -- keywords: -- --
-- keys <- many' headingKeyword -- return $ catMaybes keys --headingKeyword :: Parser Text (Maybe Keyword) -- | Attoparsec combinators for orgmode documents. module Data.OrgMode.Parse