orgmode-parse-0.1.1.3: A collection of Attoparsec combinators for parsing org-mode flavored documents.

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

Data.OrgMode.Parse.Attoparsec.Headings

Description

Parsing combinators for org-list headings.

Synopsis

Documentation

headingBelowLevel :: [Text] -> LevelDepth -> Parser Text Heading Source

Parse an org-mode heading and its contained entities (see OrgSyntax).

Headers include a hierarchy level indicated by asterisks, optional todo states, priority level, %-done stats, and tags.

** TODO [#B] Polish Poetry Essay [25%] :HOMEWORK:POLISH:WRITING:

Headings may contain:

  • A section with Planning and Clock entries
  • A number of other not-yet-implemented entities (code blocks, lists)
  • Unstructured text
  • Other heading deeper in the hierarchy

headingBelowLevel takes a list of terms to consider, state keywords, and a minumum hierarchy depth. Use 0 to parse any heading.

headingLevel :: LevelDepth -> Parser Text Level Source

Parse the asterisk indicated heading level until a space is reached.

Constrain it to LevelDepth or its children.

headingPriority :: Parser Text Priority Source

Parse the priority indicator.

If anything but these priority indicators are used the parser will fail:

  • [#A]
  • [#B]
  • [#C]

parseStats :: Parser Text Stats Source

Parse a stats block.

Accepts either form: "[m/n]" or "[n%]" and there is no restriction on m or n other than that they are integers.

parseTags :: Parser Text [Tag] Source

Parse a colon-separated list of Tags

:HOMEWORK:POETRY:WRITING: