Skip to content

rollacaster/org-parser-tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

org-parser-tree (WIP 👷)

Building upon the awesome org-parser, org-parser-tree provides utilities to create a tree structure in clojure from an org file

Usage

(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")))

Result

{: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 "****"})})})})}

resources/org-parser-tree/2020-12-22_12-37-32_screenshot.png

About

Create a Clojure tree structure from an org file

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published