 
 (defn edn-str [edn]
   (if edn
-    (str edn)))
+    (let [sb (StringBuffer.)
+          writer (StringBufferWriter. sb)]
+      (write edn :pretty true :readably true :right-margin 48 :stream writer)
+      (println (.toString sb))
+      (.toString sb))))
 
 (def edn->json-str (comp json-str edn->json))
 (def json->edn-str (comp edn-str json->edn))

    (let [source-code (first (:code source))
          syntax-checker (source-key syntax-checkers)
          syntax-error (syntax-checker source-code)]
      (println syntax-error)
      (dom/div #js {:className "source-header"}
        (dom/span #js {:className (css-classes "source-title" (if syntax-error "text-danger"))} 
          (to-title source-key))
          (if syntax-error (dom/span #js {:className "badge"} "!"))))))

(defn source-code 
  [{:keys [source is-editor?]} owner {:keys [source-key translation-fn translation-source translation-target]:as opts}]
  (reify
    om/IWillMount
    (will-mount [_]

                  :translation-target edn-chan }}))
          (dom/div  (clj->js {:className "row"})
            (om/build controls app))
          (markdown->om "resources/public/md/footer.md"
                        :container-opts #js {:className "row footer"}))))))

(when-let [target (element-by-id "app")]
  (om/root main app-state {:target target}))
