{"id":25608443,"url":"https://github.com/antonkulaga/codemirror-facade","last_synced_at":"2025-04-13T13:15:04.487Z","repository":{"id":33192054,"uuid":"36834058","full_name":"antonkulaga/codemirror-facade","owner":"antonkulaga","description":"Facade for the codemirror","archived":false,"fork":false,"pushed_at":"2017-07-15T13:09:06.000Z","size":72,"stargazers_count":10,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-13T13:14:23.467Z","etag":null,"topics":["codemirror","facade","scalajs"],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antonkulaga.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}},"created_at":"2015-06-03T22:24:44.000Z","updated_at":"2025-02-06T04:16:23.000Z","dependencies_parsed_at":"2022-08-17T20:11:03.844Z","dependency_job_id":null,"html_url":"https://github.com/antonkulaga/codemirror-facade","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonkulaga%2Fcodemirror-facade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonkulaga%2Fcodemirror-facade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonkulaga%2Fcodemirror-facade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonkulaga%2Fcodemirror-facade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antonkulaga","download_url":"https://codeload.github.com/antonkulaga/codemirror-facade/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248717238,"owners_count":21150389,"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":["codemirror","facade","scalajs"],"created_at":"2025-02-21T20:29:16.404Z","updated_at":"2025-04-13T13:15:04.463Z","avatar_url":"https://github.com/antonkulaga.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"org.denigma.codemirror facade\n=============================\n\nThis if a facade of org.denigma.codemirror library. All the code is inside org.denigma.codemirror subproject.\n\nUsage\n=====\n\nIn order to resolve a lib you should add a resolver::\n```scala\nresolvers += sbt.Resolver.bintrayRepo(\"denigma\", \"denigma-releases\") //add resolver\nlibraryDependencies += \"org.denigma\" %%% \"codemirror-facade\" % \"5.13.2-0.8\" //add dependency\n```\n\nCurrently both Scala 2.11.x and Scala 2.12.x are supported.\n\nIn your code:\n-------------\n\nAdd text area somewhere:\n\n```html\n\u003ctextarea id=\"scala\"\u003e \u003c/textarea\u003e\n```\n\nWrite some simple code \n\n```scala\n  import org.denigma.org.denigma.codemirror.extensions.EditorConfig\n  import org.denigma.org.denigma.codemirror.{CodeMirror, EditorConfiguration}\n  import org.scalajs.dom\n  import org.scalajs.dom.raw.HTMLTextAreaElement\n\n  val id = \"scala\"\n  val code = println(\"hello Scala!\") //code to add\n  val mode = \"clike\" //language mode, some modes have weird names in org.denigma.codemirror\n  val params: EditorConfiguration = EditorConfig.mode(mode).lineNumbers(true) //config\n  val editor = dom.document.getElementById(id) match {\n    case el:HTMLTextAreaElement =\u003e\n      val m = CodeMirror.fromTextArea(el,params)\n      m.getDoc().setValue(code) //add the code\n    case _=\u003e dom.console.error(\"cannot find text area for the code!\")\n  }\n```\n\n\nPreview\n-------\n\nPreview subprojects are required to see some examples of using the facade.\n\nTo run preview:\n```sbt\n    sbt //to opens sbt console\n    re-start //Use this command **instead of** run to run the app\n    Open localhost:5554 to see the result, it should reload whenever any sources are changed\n```\n\nExtensions\n----------\n\nIn org.denigma.extensions package there are some methods that extend default codemirror functionality.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonkulaga%2Fcodemirror-facade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantonkulaga%2Fcodemirror-facade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonkulaga%2Fcodemirror-facade/lists"}