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.Headings

Description

Parsing combinators for org-list headings.

Synopsis

Documentation

headingBelowLevel :: [Text.Text] -> Int -> Parser Text.Text Heading Source

Parse an org-mode heading and its contained entities (see orgmode.orgworgdev/org-syntax.html Header guidance) Headers include a hierarchy level indicated by *s, optional Todo-like state, priority level, %-done stats, and tags e.g.: ** TODO [#B] Polish Poetry Essay [25%] :HOMEWORK:POLISH:WRITING:

Headings contain directly: * 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 StateKeyword's, and a minumum hierarchy depth. Use 0 to parse any heading

headingLevel :: Int -> Parser Text.Text Int Source

Parse the asterisk indicated heading level until a space is reached. Constrain to levelReq level or its children

headingPriority :: Parser Text.Text Priority Source

Parse the priority indicator.

If anything but these priority indicators are used the parser will fail: `[B]`, `[#C]`.

parseStats :: Parser Text.Text Stats Source

Parse a Stats block.

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

parseTags :: Parser Text.Text [Tag] Source

Parse a colon-separated list of Tags

e.g. :HOMEWORK:POETRY:WRITING: