Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alandipert/537ea806516c93e037c2069b3642226f to your computer and use it in GitHub Desktop.
Save alandipert/537ea806516c93e037c2069b3642226f to your computer and use it in GitHub Desktop.
(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