tgbugs / laundry

Org mode for Racket
MIT License
54 stars 3 forks source link

+title: Laundry: Org mode for Racket

An organized racket?

How about money laundering?

Laundry list!

laundry-mode

An attempt to specify a formal grammar for [[https://orgmode.org/worg/dev/org-syntax.html][Org syntax]].

The grammars lives in [[file:./laundry/grammar/][laundry/grammar]]. The top level is in [[./laundry/grammar/org.rkt][org.rkt]]. \ The grammars are implemented using Racket's [[https://docs.racket-lang.org/brag/#%28part._.The_language%29][#lang brag]]. \ The details of the implementation are in the comments.

For an overview of the approach see [[file:./docs/overview.org]].

Laundry is available from the Racket package catalog and can be installed via

+begin_src bash

raco pkg install org laundry

+end_src

To install the development version you can run the following from the location of this readme.

+begin_src bash

raco pkg install laundry/ laundry-test/ org/ org-tools/

+end_src

Once everything is installed you can run the tests by invoking the following in the directory of this readme.

+begin_src bash

raco test laundry laundry-test org org-tools

+end_src

You can also parse individual Org files using [[file:./laundry-test/cli.rkt]].

+begin_src bash :results drawer

laundry-test/cli.rkt docs/thoughts.org laundry-test/test.org

+end_src

In particular there are a number of edge cases in the interaction between the syntax for various Org objects that have not been resolved.

This work was originally inspired by a desire to regularize the behavior of Org babel, however the lack of a consistent reference for the grammar of Org as a whole turned out to be a significant stumbling block due to the fact that Org babel interacts with nearly every aspect of Org. Therefore work to standardize Org syntax became a priority.

The long term goal of this work is to provide a reference that can be used to standardize Org syntax and behavior and to specify various levels of compliance for an implementation of Org mode.

Unfortunately for some reason providing that debug value does not result in the behavior that is articulated in the documentation, and on error the stack is not printed. You can go in and tamper inside the parsing loop of the same file and sort of get a view into what is going on.

https://alphapapa.github.io/org-almanac/#Parsing