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

Stabilitystable
MaintainerParnell Springmeyer <parnell@digitalmentat.com>
Safe HaskellNone

Data.OrgMode.Parse.Attoparsec.Headings

Description

Parsing combinators for org-list headings.

Synopsis

Documentation

data Heading Source

Constructors

Heading 

Fields

level :: Int
 
priority :: Maybe Priority
 
state :: Maybe State
 
title :: Text.Text
 
keywords :: [Keyword]
 

Instances

Eq Heading 
Show Heading 

data Priority Source

Constructors

A 
B 
C 
Unknown 

Instances

Eq Priority 
Ord Priority 
Read Priority 
Show Priority 

newtype State Source

Constructors

State Text.Text 

Instances

Eq State 
Show State 

newtype Keyword Source

Constructors

Keyword Text.Text 

Instances

Eq Keyword 
Ord Keyword 
Show Keyword 

newtype PropertyDrawer k v Source

Constructors

PropertyDrawer (HashMap k v) 

Instances

(Eq k, Eq v) => Eq (PropertyDrawer k v) 
(Show k, Show v) => Show (PropertyDrawer k v) 

heading :: TP.Parser Text.Text HeadingSource

Parse an org-mode heading.

headingLevel :: TP.Parser Text.Text IntSource

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

headingPriority :: TP.Parser Text.Text (Maybe Priority)Source

Parse the priority indicator.

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

headingTitle :: TP.Parser Text.Text (Text.Text, Maybe Keyword)Source

Title parser with alternative.

This function tries to parse a title with a keyword and if it fails it then attempts to parse everything till the end of the line.

headingKeyword :: TP.Parser Text.Text (Maybe Keyword)Source

Parse a heading keyword.

You can use this with many' and catMaybes to get a list keywords:

 keys <- many' headingKeyword
 return $ catMaybes keys