A collection of Attoparsec combinators for parsing org-mode flavored documents.
|Latest on Hackage:||0.2.2|
This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.
orgmode-parse provides a top-level parser and collection of attoparsec parser
combinators for org-mode structured text.
You can find the package on Hackage.
We have built attoparsec parsers for parsing org-mode document structures and meta-data. Here is a list of all the syntax features that have a complete parsing implementation and not:
- [X] Headlines
- [X] State keywords
- [X] Priority indicator
- [X] Title
- [X] Status / progress indicator
- [X] Tag list
- [X] Property drawers
- [X] State keyword changelogs
- [X] Scheduled and deadline timestamps (timestamp, range, duration, periodicity)
- [X] Active and inactive timestamps
- [X] Clock timestamps
- [ ] Markup
- [ ] Emphasis
- [ ] Bold
- [ ] Italic
- [ ] Strikethrough
- [ ] Underline
- [ ] Superscript
- [ ] Subscript
- [ ] Code / monospaced
- [ ] Tables
- [ ] Lists
- [ ] Unordered lists
- [ ] Numbered lists
- [ ] Checkbox modified lists
- [ ] Blocks (src / quote / example blocks)
- [ ] Emphasis
Parsing org-mode markup is currently being worked on.
What’s Planned (outside of what’s not finished)
- Modernizing this library and adding significantly more documentation to it
- Writing a sister library,
orgmode-pretty, providing a pretty printer implementation for an org-mode AST
- Pandoc integration
There are a few ways to build this library if you’re developing a patch:
stack build && stack test, and
nix-build --no-out-link --attr orgmode-parse release.nix
You can also use the
nix-shell provided cabal environment for incremental
$ nix-shell --attr orgmode-parse.env release.nix $ cabal build
Projects that use this package:
- Support building with GHC 8.4.3 (thank you @zhujinxuan!)
- Fix property drawer parsing of :END: delimiter, fixes #35
- Fix timestamp parsing in headline and body, fixes #13
- Generalize drawer parser for logbook and generic drawers, fixes #14
- Reorganize the types, fixes #15
- The weekday parser now correctly parses weekday appellations of other languages (thank you nushio3!) using a combinator-style version of the regex found in org-mode.
- Comment improvement wibbles.
- Adding the =Attoparsec= combinator modules to the export module list in the cabal package definition.
- Sub-headings are now parsed and tracked by its parent.
- Much more robust timestamp / clock / schedule parsing.
- A good mount of code cleanup and comment improvement.
- [X] Fixing the import for the =Internal= module (instead of re-exporting it in each parser module).
- [X] Added parsers for the scheduled / deadline timestamps.
- [X] Parsing of property drawer.
- [X] Tests for both drawer and heading parsers.
- [X] Parsers for orgmode list headlines.