 
 (defn reporender
   "Render repository trees"
-  [data]
-  (map-indexed node (get data "tree")))
+  []
+  (map-indexed node (get (querydb [:data]) "tree")))
 
-(defn ctrl []
-  {:db REPO})
+(defn ctrl [])
 
 (defn viewer
   [ctrl]
-  (println "rendering")
   (nm "div" [(nm "h1" "RepoDoc App")
-             (nm "div" (reporender (:db ctrl)))]))
+             (nm "div" (reporender))]))
 
 
 ;; Setup

  (let [w (t/writer :json)]
    (t/write w data)))


;; App

(defn annotate
  [item index]
  (if (= (get item "type") "blob")
    (nm "button.pure-button" "Annotate")))

(defn node
  "Renders one node from tree with indentation"

(def app {:controller ctrl :view viewer})

(defn setup []
  (.mount js/m
           (.getElementById js/document "app")
           (clj->js app)))

