orgmode-parse-0.1.0: A parser and writer for org-mode flavored documents.

Copyright© 2014 Parnell Springmeyer
LicenseAll Rights Reserved
MaintainerParnell Springmeyer <parnell@digitalmentat.com>
Stabilitystable
Safe HaskellNone
LanguageHaskell2010

Data.OrgMode.Parse.Attoparsec.Time

Description

Parsing combinators for org-mode active and inactive timestamps.

Synopsis

Documentation

parsePlannings :: Parser Text.Text (HashMap PlanningKeyword Timestamp) Source

Parse a planning line

Plannings live in 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: 17:00 CLOSED: 12: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 appending two timepoints with '--' in between, or by appending two hh:mm stamps together in a single timepoint with a single -

Each timepoint includes an optional repeater flag and an optional delay flag

parseBracketedDateTime :: Parser Text.Text (DateTime, Maybe (Hours, Minutes), Bool) Source

Parse a single time part

e.g. [2015-03-27 Fri 10:20 +4h] returning: * 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

parseDay :: Parser Text.Text Text.Text Source

Parse a 3-character day name

parseTime' :: Parser Text.Text (Either (Hours, Minutes) ((Hours, Minutes), (Hours, Minutes))) 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

parseHM :: Parser Text.Text (Hours, Minutes) Source

Parse a single HH:MM point

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"