Created
May 11, 2016 13:09
-
-
Save alandipert/537ea806516c93e037c2069b3642226f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(page "codemirror.html" | |
(:require | |
[cljsjs.codemirror])) | |
(defn codemirror [& opts] | |
(with-let [ta (textarea)] | |
(with-init! | |
(.fromTextArea | |
js/CodeMirror | |
ta | |
(js->clj (apply hash-map opts)))))) | |
(body | |
(head | |
(title "CodeMirror Test") | |
(link :href "cljsjs/codemirror/development/codemirror.css" :rel "stylesheet")) | |
(body | |
(codemirror | |
:value "function myScript(){return 100;}\n" | |
:mode "javascript" | |
:lineNumbers true) | |
(h1 "CodeMirror test"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment