Building upon the awesome org-parser, org-parser-tree
provides utilities to create a tree structure in clojure from an org file
(ns hello-world.core
(:require [tech.thomas-sojka.org-parser-tree.core :as org-parse-tree]))
(let [journal "* 2019
** Unordered
*** Sometime
**** Clojure Spec basics :LEARN:TUTORIAL:
** 2019-01 January
*** KW01
**** Build a snowman :SOCIAL:
**** Game night :SOCIAL:"]
(->> journal
org-parse-tree/parse-tree
org-parse-tree/vizualize-tree)
(->> journal
org-parse-tree/parse-tree
(org-parse-tree/store-tree "resources/journal.edn")))
{:title "root",
:stars "",
:children
({:tags nil,
:type :head-line,
:title "2019",
:stars "*",
:children
({:tags nil,
:type :head-line,
:title "Unordered",
:stars "**",
:children
({:tags nil,
:type :head-line,
:title "Sometime",
:stars "***",
:children
({:tags ("LEARN" "TUTORIAL"),
:type :head-line,
:title "Clojure Spec basics",
:stars "****",
:children []})})}
{:tags nil,
:type :head-line,
:title "2019-01 January",
:stars "**",
:children
({:tags nil,
:type :head-line,
:title "KW01",
:stars "***",
:children
({:tags ("SOCIAL"),
:type :head-line,
:title "Build a snowman",
:stars "****",
:children []}
{:tags ("SOCIAL"),
:type :head-line,
:title "Game night",
:stars "****"})})})})}