| (page "index.html" | |
| (:require | |
| [codemirror.core :as cm])) | |
| (defc text-contents "(+ 1 1)") | |
| (defc indent-unit 2) | |
| (cell= (pr :text-contents text-contents)) | |
| (cell= (pr :indent-unit indent-unit)) | |
| (with-timeout 2000 | |
| (reset! text-contents "(defn f [x]\n (+ x 1))")) | |
| (html | |
| (head | |
| (link :rel "stylesheet" :href "cljsjs/codemirror/development/codemirror.css")) | |
| (body | |
| (h1 "hi there") | |
| (button :click #(swap! indent-unit - 2) "<<") | |
| (button :click #(swap! indent-unit + 2) ">>") | |
| (cm/editor | |
| :state text-contents | |
| ::cm/config (cell= {:indentUnit indent-unit})))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment