   (fn [$el]
     (om/root
       examples/$examples
-      {:examples [{:body "user=> (foo)"
-                   :user {:email "zachary.kim@gmail.com"}
-                   :history [{:user {:email "lee@writequit.org"}}
-                             {:user {:email "zachary.kim@gmail.com"}}]}
-                  {:body "user=> (map #(vector (first %) (* 2 (second %)))
-            {:a 1 :b 2 :c 3})
-
-([:a 2] [:b 4] [:c 6])
-
-user=> (into {} *1)
-{:a 2, :b 4, :c 6}"
-                   :user {:email "zachary.kim@gmail.com"}
-                   :history [{:user {:email "masondesu@gmail.com"}}
-                             {:user {:email "lee@writequit.org"}}
-                             {:user {:email "zachary.kim@gmail.com"}}]}
-                  {:body "user=> (map #(vector (first %) (* 2 (second %)))
-            {:a 1 :b 2 :c 3})
-
-([:a 2] [:b 4] [:c 6])
-
-user=> (into {} *1)
-{:a 2, :b 4, :c 6}"
-                   :user {:email "zachary.kim@gmail.com"}
-                   :history [{:user {:email "foo@barrrrrrr.com"}}
-                             {:user {:email "foo@barrrrrr.com"}}
-                             {:user {:email "foo@barrrrr.com"}}
-                             {:user {:email "foo@barrrr.com"}}
-                             {:user {:email "foo@barrr.com"}}
-                             {:user {:email "foo@barr.com"}}
-                             {:user {:email "foo@bar.com"}}
-                             {:user {:email "fickamanda@gmail.com"}}
-                             {:user {:email "brentdillingham@gmail.com"}}
-                             {:user {:email "masondesu@gmail.com"}}
-                             {:user {:email "lee@writequit.org"}}
-                             {:user {:email "zachary.kim@gmail.com"}}]}]
-       :var {:name "bar" :ns "foo"}}
+      {:examples [ex-example-0
+                  ex-example-1
+                  ex-example-2]}
       {:target $el}))
 
   :.sg-add-example
   (fn [$el]
     (om/root
       examples/$add
-      {}
-      {:target $el :init-state {:expanded? true}}))
+      {:editing? true}
+      {:target $el}))
 
   :.sg-add-example-loading
   (fn [$el]
     (om/root
       examples/$add
-      {}
+      {:editing? true :loading? true :body "(defn greet [name]\n  (println \"Hello\" name))"}
+      {:target $el}))
+
+  :.sg-add-example-errors
+  (fn [$el]
+    (om/root
+      examples/$add
+      {:editing? true :body "(defn greet [name]\n  (println \"Hello\" name))"}
       {:target $el
-       :init-state {:expanded? true
-                    :loading? true
-                    :text "(defn greet [name]\n  (println \"Hello\" name))"}}))
-
-  :.sg-add-example-errors
-  (fn [$el]
-    (om/root
-      examples/$add
-      {}
-      {:target $el
-       :init-state {:expanded? true
-                    :error-message "This is where error messages that apply to the whole form go. And here's some other text to show what happens with a very long error message."
-                    :text "(defn greet [name]\n  (println \"Hello\" name))"}}))
+       :init-state {:error-message "This is where error messages that apply to the whole form go. And here's some other text to show what happens with a very long error message."}}))
+
+  :.sg-edit-example
+  (fn [$el]
+    (om/root
+      examples/$example
+      (merge
+        ex-example-0
+        {:editing? true
+         :can-delete? true})
+      {:target $el}))
+
+  :.sg-delete-example
+  (fn [$el]
+    (om/root
+      examples/$example-meta
+      {:body "user=> (foo)"
+       :author {:login "zk" :account-source "github" :avatar-url "https://avatars.githubusercontent.com/u/7194?v=2"}
+       :history [{:author {:login "dakrone" :account-source "github" :avatar-url "https://avatars3.githubusercontent.com/u/19060?v=2&s=460"}}]
+       :can-delete? true}
+      {:target $el}))
+
+  :.sg-delete-example-confirm
+  (fn [$el]
+    (om/root
+      examples/$example-meta
+      {:body "user=> (foo)"
+       :author {:login "zk" :account-source "github" :avatar-url "https://avatars.githubusercontent.com/u/7194?v=2"}
+       :history [{:author {:login "dakrone" :account-source "github" :avatar-url "https://avatars3.githubusercontent.com/u/19060?v=2&s=460"}}]
+       :can-delete? true}
+      {:target $el :init-state {:delete-state :confirm}}))
+
+  :.sg-delete-example-loading
+  (fn [$el]
+    (om/root
+      examples/$example-meta
+      {:body "user=> (foo)"
+       :author {:login "zk" :account-source "github" :avatar-url "https://avatars.githubusercontent.com/u/7194?v=2"}
+       :history [{:author {:login "dakrone" :account-source "github" :avatar-url "https://avatars3.githubusercontent.com/u/19060?v=2&s=460"}}]
+       :can-delete? true}
+      {:target $el :init-state {:delete-state :loading}}))
+
+  :.sg-delete-example-error
+  (fn [$el]
+    (om/root
+      examples/$example-meta
+      {:body "user=> (foo)"
+       :author {:login "zk" :account-source "github" :avatar-url "https://avatars.githubusercontent.com/u/7194?v=2"}
+       :history [{:author {:login "dakrone" :account-source "github" :avatar-url "https://avatars3.githubusercontent.com/u/19060?v=2&s=460"}}]
+       :can-delete? true}
+      {:target $el :init-state {:delete-state :error}}))
 
   :.sg-notes-null-state
   (fn [$el]


(wire-search text-chan app-state)

(on-el-om
  [:.examples-widget examples/$examples]
  [:.see-alsos-widget see-alsos/$see-alsos]
  [:.search-widget search/$quick-lookup {:init-state {:text-chan text-chan}}]
  [:.quick-search-widget search/$quick-search {:init-state {:text-chan text-chan}}]

    ;; ctrl-s to focus search input
    (when (and (.-ctrlKey e) (= 83 (.-keyCode e)))
      (doseq [$el (sel ".search input[name='query']")]
        (.focus $el)))))

(def tog (atom false))
