{"id":23626267,"url":"https://github.com/yetanalytics/re-codemirror","last_synced_at":"2025-11-07T17:30:40.032Z","repository":{"id":42001010,"uuid":"238988182","full_name":"yetanalytics/re-codemirror","owner":"yetanalytics","description":"A reagent component that wraps CodeMirror","archived":false,"fork":false,"pushed_at":"2024-01-17T21:22:42.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-28T00:25:16.499Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yetanalytics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-07T17:39:36.000Z","updated_at":"2022-03-23T17:23:37.000Z","dependencies_parsed_at":"2024-12-27T23:06:19.616Z","dependency_job_id":null,"html_url":"https://github.com/yetanalytics/re-codemirror","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yetanalytics%2Fre-codemirror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yetanalytics%2Fre-codemirror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yetanalytics%2Fre-codemirror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yetanalytics%2Fre-codemirror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yetanalytics","download_url":"https://codeload.github.com/yetanalytics/re-codemirror/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239533784,"owners_count":19654765,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-27T22:52:42.147Z","updated_at":"2025-11-07T17:30:39.982Z","avatar_url":"https://github.com/yetanalytics.png","language":"Clojure","readme":"# re-codemirror\nA reagent component that wraps [CodeMirror](https://codemirror.net/) and provides entry points for a reactive state manager.\n\n## Usage\nTo use `re-codemirror` add the git dependency to your project and use the latest sha release.\n\n### Basic\n\n```clojure\n(ns ...\n  (require [re-codemirror.core :as re-cm]))\n\n;; Reagent Component\n(defn editor\n  []\n  [re-cm/codemirror\n   {:lineNumbers true}\n   {:name \"form-input\"}])\n```\n\n### Mode\n\n```clojure\n(ns ...\n  (require ...\n           [cljsjs.codemirror.mode.clojure]))\n\n;; CodeMirror component\n(defn clojure-editor\n  []\n  [re-cm/codemirror\n   {:mode \"clojure\"}\n   {:name \"form-input}])\n```\n\n### Linting\n\n```clojure\n(ns ...\n  (require ...\n           [cljsjs.codemirror.mode.javascript]\n           [cljsjs.codemirror.addon.lint.javascript-lint]))\n           \n;; CodeMirror component\n(defn javascript-editor\n  []\n  [re-cm/codemirror\n   {:mode    \"javascript\"\n    :gutters [\"CodeMirror-link-markers\"]\n    :lint    true}\n   {:name \"form-input\"}])\n```\n\n### Reactive Statement Management\n\nManage state through [re-frame](https://github.com/yetanalytics/re-frame).\n\n```clojure\n(ns ...\n  (require ...\n           [re-frame.core :refer [subscribe dispatch]]))\n\n;; CodeMirror component\n(defn re-frame-editor\n  [sub-key dis-key]\n  [re-cm/codemirror\n   {}\n   {:name   \"form-input\"\n    ;; subscribe to re-frame and get a possible text value\n    :value  @(subscribe [sub-key])\n    ;; This supports a simple use case of just catching when the text value changes.\n    ;; Update the full text value from the .getValue function from CodeMirror\n    ;; Any event can be added that is supported through CodeMirror in the map\n    ;;    \"name\" (callback-fn ...)\n    :events {\"change\" (fn [this [code-mirror-obj change-obj]]\n                        (dispatch [dis-key (.getValue code-mirror-obj)]))}}])\n```\n\nYou can also manage state through any other library of your choice.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyetanalytics%2Fre-codemirror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyetanalytics%2Fre-codemirror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyetanalytics%2Fre-codemirror/lists"}