-- 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?), serialized for storage, etc... @package orgmode-parse @version 0.0.2.0 -- | 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 data Schedule Schedule :: ScheduleType -> Maybe Timestamp -> Maybe Text -> Schedule schedule_type :: Schedule -> ScheduleType timestamp :: Schedule -> Maybe Timestamp recurring :: Schedule -> Maybe Text data ScheduleType SCHEDULED :: ScheduleType DEADLINE :: ScheduleType APPOINTMENT :: ScheduleType data Timestamp Active :: LocalTime -> Timestamp Inactive :: LocalTime -> Timestamp newtype Open Open :: Char -> Open newtype Close Close :: Char -> Close 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-mode active and inactive timestamps. module Data.OrgMode.Parse.Attoparsec.Time 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 data Schedule Schedule :: ScheduleType -> Maybe Timestamp -> Maybe Text -> Schedule schedule_type :: Schedule -> ScheduleType timestamp :: Schedule -> Maybe Timestamp recurring :: Schedule -> Maybe Text data ScheduleType SCHEDULED :: ScheduleType DEADLINE :: ScheduleType APPOINTMENT :: ScheduleType data Timestamp Active :: LocalTime -> Timestamp Inactive :: LocalTime -> Timestamp newtype Open Open :: Char -> Open newtype Close Close :: Char -> Close toPriority :: Text -> Priority -- | Parse an org-mode timestamp line with user-supplied opening and ending -- brackets (for either active or inactive stamps). parseTimestamp :: Open -> Close -> Parser Text (Maybe Schedule) -- | Parse the type of schedule. scheduleType :: Parser Text ScheduleType -- | 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 data Schedule Schedule :: ScheduleType -> Maybe Timestamp -> Maybe Text -> Schedule schedule_type :: Schedule -> ScheduleType timestamp :: Schedule -> Maybe Timestamp recurring :: Schedule -> Maybe Text data ScheduleType SCHEDULED :: ScheduleType DEADLINE :: ScheduleType APPOINTMENT :: ScheduleType data Timestamp Active :: LocalTime -> Timestamp Inactive :: LocalTime -> Timestamp newtype Open Open :: Char -> Open newtype Close Close :: Char -> Close 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