Coder Social home page Coder Social logo

mshafir / ivy-codemirror Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ivyapp/ivy-codemirror

0.0 2.0 0.0 2.07 MB

An Ember component for the excellent CodeMirror editor.

Home Page: http://ivyapp.github.io/ivy-codemirror/

License: MIT License

JavaScript 82.17% Shell 5.75% HTML 6.30% CSS 0.12% Handlebars 5.66%

ivy-codemirror's Introduction

ivy-codemirror

Build Status

An Ember component for the excellent CodeMirror editor.

Installation

As an ember-cli addon:

npm install --save-dev ivy-codemirror
ember generate ivy-codemirror

Or if you aren't using ember-cli, you can use this library as a standalone Bower package:

bower install --save ivy-codemirror

...and then add the ivy-codemirror.js script to your page.

Usage

{{ivy-codemirror value=myCode}}

There are also a handful of CodeMirror options you can bind to as well:

  • autofocus
  • coverGutterNextToScrollbar
  • electricChars
  • extraKeys
  • firstLineNumber
  • fixedGutter
  • historyEventDelay
  • indentUnit
  • indentWithTabs
  • keyMap
  • lineNumbers
  • lineWrapping
  • mode
  • readOnly
  • rtlMoveVisually
  • showCursorWhenSelecting
  • smartIndent
  • tabSize
  • tabindex
  • theme
  • undoDepth

Themes / Modes

By default, only codemirror.css (CodeMirror's default theme) is included. To include more themes, modes, and key maps, add codemirror options to Brocfile.js inside your app:

var app = new EmberApp({
  codemirror: {
    modes: ['javascript'],
    keyMaps: ['vim'],
    themes: ['solarized']
  }
});

The above example would pull in mode/javascript/javascript.js, keymap/vim.js, theme/solarized.css from CodeMirror and add them to vendor.js and vendor.css, respectively.

Contributing

Fork this repo, make a new branch, and send a pull request. Make sure your change is tested or it won't be merged.

To run tests:

git clone # <this repo>
npm install
npm test

Or, to start a test server that continually runs (for development):

ember test --server

ivy-codemirror's People

Contributors

omghax avatar indream avatar gaurav0 avatar heroiceric avatar

Watchers

James Cloos avatar Michael Shafir avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.