             {:title "Thank you"
              :text "Please evaluate my talk via the mobile app!"}]))}))
 
-(defn source-snippet [data owner fname]
+(defn source-snippet [data owner {}]
+  (reify
+    om/IWillMount
+    (will-mount [_]
+      (GET (str "/js/" (get-in data [:code :source]))
+          (-> {:handler (fn [e]
+                          (om/set-state! owner
+                                         :text (if-let [[from to] (get-in @data [:code :range])]
+                                                 (->>
+                                                  (string/split-lines e)
+                                                  (drop (dec from))
+                                                  (take (- to from))
+                                                  (interpose "\n")
+                                                  (apply str))
+                                                 e)))
+               :headers {"Accept" "text/plain"}
+               :response-format :raw})))
+    om/IRender
+    (render [_]
+      (html
+       [:div]))
+    om/IDidUpdate
+    (did-update [this prev-props prev-state]
+      (when (om/get-state owner :text)
+        (let [n (om/get-node owner)]
+          (while (.hasChildNodes n)
+            (.removeChild n (.-lastChild n))))
+        (let [pre (.createElement js/document "pre")]
+          (set! (.-innerHTML pre) (.-value (hljs.highlightAuto (om/get-state owner :text))))
+          (.appendChild (om/get-node owner) pre)
+          )))))
+
+(defn clj-source-snippet [data owner fname]
   (reify
     om/IWillMount
     (will-mount [_]

                    :radius 60 :font-size "40pt"}
             }

            {:subtitle "catch game"
             :custom catch-game-slide
             :opts {:width 600 :height 600
                    :circles 13

             )

           (when-let [code (:code data)]
             (om/build source-snippet data {:opts code})
             )
           ]
          ])))))
