diff --git a/project.clj b/project.clj old mode 100644 new mode 100755 index 6cb885f..957ea00 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject codemirror-parinfer "0.0-SNAPSHOT" +(defproject viebel/codemirror-parinfer "0.0.3" :description "site for illustrating the value of Parinfer" :url "http://shaunlebron.github.io/parinfer" @@ -6,14 +6,14 @@ :url "https://github.com/shaunlebron/parinfer/blob/master/LICENSE.md" :distribution :repo} - :dependencies [[org.clojure/clojure "1.7.0"] - [org.clojure/clojurescript "1.7.122"] + :dependencies [[org.clojure/clojure "1.8.0"] + [org.clojure/clojurescript "1.9.293"] [parinfer "0.2.3"]] - :plugins [[lein-cljsbuild "1.1.0"] - [lein-figwheel "0.4.0"]] + :plugins [[lein-cljsbuild "1.1.3"] + [lein-figwheel "0.5.8"]] - :source-paths [] + :source-paths ["src"] :clean-targets ^{:protect false} ["resources/public/js/compiled/out" "target"] @@ -31,7 +31,7 @@ :source-paths ["src"] :compiler {:output-to "resources/public/js/compiled/parinfer.js" :externs ["resources/public/codemirror/lib/closure-externs.js"] - :main parinfer-codemirror.example + :main parinfer-codemirror.editor :optimizations :advanced :pretty-print false}} diff --git a/src/parinfer_codemirror/editor.cljs b/src/parinfer_codemirror/editor.cljs index a903b50..90f2918 100644 --- a/src/parinfer_codemirror/editor.cljs +++ b/src/parinfer_codemirror/editor.cljs @@ -104,3 +104,9 @@ ;; sync state changes to the editor (add-watch state :editor-updater on-state-change) (force-editor-sync!)) + +(defn ^:export parinferize-and-sync! + "Add parinfer goodness to a codemirror editor" + [cm key- parinfer-mode initial-value] + (parinferize! cm key- parinfer-mode initial-value) + (start-editor-sync!)) diff --git a/src/parinfer_codemirror/example.cljs b/src/parinfer_codemirror/example.cljs index aba9b30..8f67d77 100644 --- a/src/parinfer_codemirror/example.cljs +++ b/src/parinfer_codemirror/example.cljs @@ -56,8 +56,8 @@ cm)))) (defn render-dev! [] - + (create-editor! "code-indent-mode" :indent-mode) - + (create-editor! "code-paren-mode" :paren-mode {:parinfer-mode :paren-mode}) - + (start-editor-sync!)) -+ -+(render-dev!) + (create-editor! "code-indent-mode" :indent-mode) + (create-editor! "code-paren-mode" :paren-mode {:parinfer-mode :paren-mode}) + (start-editor-sync!)) + +(render-dev!)