diff --git a/org_mode_samples/.gitignore b/org_mode_samples/.gitignore new file mode 100644 index 00000000..fcf91aa3 --- /dev/null +++ b/org_mode_samples/.gitignore @@ -0,0 +1 @@ +*.tree.txt diff --git a/org_mode_samples/common.el b/org_mode_samples/common.el new file mode 100644 index 00000000..482bbb4b --- /dev/null +++ b/org_mode_samples/common.el @@ -0,0 +1,8 @@ +(defun org-dump-ast (outpath) + (let + ((parsed-tree (format "%s" (org-element-parse-buffer)))) + (with-temp-file outpath + (insert parsed-tree) + ) + ) + ) diff --git a/org_mode_samples/dump_org_ast.bash b/org_mode_samples/dump_org_ast.bash new file mode 100755 index 00000000..8ccd247c --- /dev/null +++ b/org_mode_samples/dump_org_ast.bash @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# +set -euo pipefail +IFS=$'\n\t' +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +INPUT_FILE="$1" +OUTPUT_FILE="$2" + +INIT_SCRIPT=$(cat < + +.PHONY: all +all: paragraphs.tree.txt + +.PHONY: clean +clean: +> rm -rf *.tree.txt + +%.tree.txt: %.org +> ../dump_org_ast.bash $< $@ diff --git a/org_mode_samples/plain_lists/paragraphs.org b/org_mode_samples/plain_lists/paragraphs.org new file mode 100644 index 00000000..71c05876 --- /dev/null +++ b/org_mode_samples/plain_lists/paragraphs.org @@ -0,0 +1,3 @@ +1. foo +2. bar +(message "%s" (org-element-parse-buffer))