Copyright | © 2014 Parnell Springmeyer |
---|---|
License | All Rights Reserved |
Maintainer | Parnell Springmeyer <parnell@digitalmentat.com> |
Stability | stable |
Safe Haskell | None |
Language | Haskell2010 |
Parsing combinators for org-mode active and inactive timestamps.
- parsePlannings :: Parser Text.Text (HashMap PlanningKeyword Timestamp)
- parseClock :: Parser Text.Text (Maybe Timestamp, Maybe Duration)
- parseTimestamp :: Parser Text.Text Timestamp
- type Weekday = Text.Text
- data BracketedDateTime = BracketedDateTime {}
- parseBracketedDateTime :: Parser Text.Text BracketedDateTime
- transformBracketedDateTime :: BracketedDateTime -> (DateTime, Maybe (Hours, Minutes), Bool)
- parseDay :: Parser Text.Text Text.Text
- type AbsoluteTime = (Hours, Minutes)
- type TimestampRange = (AbsoluteTime, AbsoluteTime)
- newtype TimePart = TimePart (Either AbsoluteTime TimestampRange)
- parseTime' :: Parser Text.Text TimePart
- parseDate :: Parser Text.Text YearMonthDay
- parseHM :: Parser Text.Text (Hours, Minutes)
- parseTimeUnit :: Parser Text.Text TimeUnit
- parseRepeater :: Parser Text.Text Repeater
- parseDelay :: Parser Text.Text Delay
Documentation
parsePlannings :: Parser Text.Text (HashMap PlanningKeyword Timestamp) Source
Parse a planning line.
Plannings inhabit a heading section and are formatted as a keyword and a timestamp. There can be more than one, but they are all on the same line e.g:
DEADLINE: <2015-05-10 17:00> CLOSED: <2015-04-1612:00>
parseClock :: Parser Text.Text (Maybe Timestamp, Maybe Duration) Source
Parse a clock line.
A heading's section contains one line per clock entry. Clocks may have a timestamp, a duration, both, or neither e.g.:
CLOCK: [2014-12-10 Fri 2:30]--[2014-12-10 Fri 10:30] => 08:00
parseTimestamp :: Parser Text.Text Timestamp Source
Parse a timestamp.
Timestamps may be timepoints or timeranges, and they indicate whether they are active or closed by using angle or square brackets respectively.
Time ranges are formatted by infixing two timepoints with a double
hyphen, --
; or, by appending two hh:mm
timestamps together in a
single timepoint with one hyphen -
.
Each timepoint includes an optional repeater flag and an optional delay flag.
parseBracketedDateTime :: Parser Text.Text BracketedDateTime Source
Parse a single time part.
[2015-03-27 Fri 10:20 +4h]
Returns: - The basic timestamp - Whether there was a time interval in place of a single time (this will be handled upstream by parseTimestamp) - Whether the time is active or inactive
transformBracketedDateTime :: BracketedDateTime -> (DateTime, Maybe (Hours, Minutes), Bool) Source
type AbsoluteTime = (Hours, Minutes) Source
type TimestampRange = (AbsoluteTime, AbsoluteTime) Source
parseTime' :: Parser Text.Text TimePart Source
Parse the time-of-day part of a time part, as a single point or a time range.
parseDate :: Parser Text.Text YearMonthDay Source
Parse the YYYY-MM-DD part of a time part.
parseTimeUnit :: Parser Text.Text TimeUnit Source
Parse the Timeunit part of a delay or repeater flag.
parseRepeater :: Parser Text.Text Repeater Source
Parse a repeater flag, e.g. .+4w
, or ++1y
.
parseDelay :: Parser Text.Text Delay Source
Parse a delay flag, e.g. --1d
or -2w
.