All Projects → antonkulaga → Codemirror Facade

antonkulaga / Codemirror Facade

Licence: mpl-2.0
Facade for the codemirror

Programming Languages

scala
5932 projects
scalajs
39 projects

Projects that are alternatives of or similar to Codemirror Facade

react-native-codeditor
React Native component to display code editor using WebView and CodeMirror
Stars: ✭ 21 (+162.5%)
Mutual labels:  codemirror
codeRigade
Realtime collaborative code-editor
Stars: ✭ 17 (+112.5%)
Mutual labels:  codemirror
Plantuml Editor
PlantUML online demo client
Stars: ✭ 313 (+3812.5%)
Mutual labels:  codemirror
codemirror-colorpicker
colorpicker with codemirror
Stars: ✭ 113 (+1312.5%)
Mutual labels:  codemirror
codemirror-languageserver
Language Server integration for CodeMirror 6
Stars: ✭ 37 (+362.5%)
Mutual labels:  codemirror
Nova-Dark-Theme
A dark theme for Laravel Nova
Stars: ✭ 72 (+800%)
Mutual labels:  codemirror
clojure-mode
Clojure/Script mode for CodeMirror 6
Stars: ✭ 105 (+1212.5%)
Mutual labels:  codemirror
Graviton App
🚀 A modern-looking Code Editor
Stars: ✭ 601 (+7412.5%)
Mutual labels:  codemirror
markdown-editor
✏️ A very simple but useful Markdown Previewer and Markdown Editor with CodeMirror, Markedjs, and Create-react-app
Stars: ✭ 25 (+212.5%)
Mutual labels:  codemirror
codemirror-editor-vue3
CodeMirror component for Vue3
Stars: ✭ 22 (+175%)
Mutual labels:  codemirror
nwotable
One app for all your notes on all your devices.
Stars: ✭ 22 (+175%)
Mutual labels:  codemirror
craft3-codemirror
Add the awesome in-browser code editor CodeMirror as a field type.
Stars: ✭ 17 (+112.5%)
Mutual labels:  codemirror
CodeMirror-MathJax
Experimenting to replace $math$ with formulas inside CodeMirror
Stars: ✭ 18 (+125%)
Mutual labels:  codemirror
CodeMirror-Swift
CodeMirror-Swift is a lightweight wrapper of CodeMirror for macOS and iOS
Stars: ✭ 71 (+787.5%)
Mutual labels:  codemirror
Noty
Autosaving sticky note with support for multiple notes without needing multiple windows.
Stars: ✭ 321 (+3912.5%)
Mutual labels:  codemirror
vue-showdowns-editor
A markdown editor using codemirror and previewer using @jhuix/showdowns for Vue.js.
Stars: ✭ 27 (+237.5%)
Mutual labels:  codemirror
Scripts-n-Styles
Allows WordPress admin users the ability to add custom CSS and JavaScript directly to individual Post, Pages or custom post types.
Stars: ✭ 16 (+100%)
Mutual labels:  codemirror
Md2pdf
Offline markdown to pdf, choose -> edit -> transform 🥂
Stars: ✭ 632 (+7800%)
Mutual labels:  codemirror
Angular Admin
🔏Admin client for surmon.me blog powered by @angular and Bootstrap4
Stars: ✭ 352 (+4300%)
Mutual labels:  codemirror
notebook
Web based Clojure notebook application/-library.
Stars: ✭ 96 (+1100%)
Mutual labels:  codemirror

org.denigma.codemirror facade

This if a facade of org.denigma.codemirror library. All the code is inside org.denigma.codemirror subproject.

Usage

In order to resolve a lib you should add a resolver::

resolvers += sbt.Resolver.bintrayRepo("denigma", "denigma-releases") //add resolver
libraryDependencies += "org.denigma" %%% "codemirror-facade" % "5.13.2-0.8" //add dependency

Currently both Scala 2.11.x and Scala 2.12.x are supported.

In your code:

Add text area somewhere:

<textarea id="scala"> </textarea>

Write some simple code

  import org.denigma.org.denigma.codemirror.extensions.EditorConfig
  import org.denigma.org.denigma.codemirror.{CodeMirror, EditorConfiguration}
  import org.scalajs.dom
  import org.scalajs.dom.raw.HTMLTextAreaElement

  val id = "scala"
  val code = println("hello Scala!") //code to add
  val mode = "clike" //language mode, some modes have weird names in org.denigma.codemirror
  val params: EditorConfiguration = EditorConfig.mode(mode).lineNumbers(true) //config
  val editor = dom.document.getElementById(id) match {
    case el:HTMLTextAreaElement =>
      val m = CodeMirror.fromTextArea(el,params)
      m.getDoc().setValue(code) //add the code
    case _=> dom.console.error("cannot find text area for the code!")
  }

Preview

Preview subprojects are required to see some examples of using the facade.

To run preview:

    sbt //to opens sbt console
    re-start //Use this command **instead of** run to run the app
    Open localhost:5554 to see the result, it should reload whenever any sources are changed

Extensions

In org.denigma.extensions package there are some methods that extend default codemirror functionality.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].