{-# LANGUAGE OverloadedStrings #-}
module Data.OrgMode.Parse.Attoparsec.Drawer.Logbook
( parseLogbook
)
where
import Control.Applicative ((*>))
import Data.Attoparsec.Text
import Data.Attoparsec.Types as Attoparsec
import Data.Text (Text)
import Data.OrgMode.Parse.Attoparsec.Drawer.Generic as Drawer.Generic
import Data.OrgMode.Parse.Attoparsec.Time (parseClock)
import Data.OrgMode.Types
parseLogbook :: Attoparsec.Parser Text Logbook
parseLogbook = Logbook <$> (drawerBegin *> manyTill parseClock Drawer.Generic.drawerEnd)
where
drawerBegin = Drawer.Generic.parseDrawerDelim "LOGBOOK"