codemirror-cljs

A ClojureScript wrapper for CodeMirror, making it easy to integrate this powerful code editor into your ClojureScript applications.

Features

  • ClojureScript Integration: Use CodeMirror seamlessly in ClojureScript projects
  • Syntax Highlighting: Support for various programming languages
  • Customizable: Configure the editor to match your needs
  • Reactive: Works well with React-based frameworks
  • Lightweight: Minimal overhead on top of CodeMirror

Installation

Add the dependency to your project:

1
2
3
4
5
6
;; deps.edn
{:deps
 {com.moclojer/codemirror-cljs {:mvn/version "latest-version"}}}

;; Leiningen/Boot
[com.moclojer/codemirror-cljs "latest-version"]

Usage Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
(ns my-app.core
  (:require [com.moclojer.codemirror-cljs.core :as cm]))

(defn code-editor []
  [cm/editor
   {:value "(defn hello [name]\n  (str \"Hello, \" name \"!\"))"
    :options {:mode "clojure"
              :theme "dracula"
              :lineNumbers true}
    :on-change #(js/console.log "Code changed:" %)}])

View on GitHub