Coder Social home page Coder Social logo

sebastianmaier / codemirror-rails Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fixlr/codemirror-rails

1.0 2.0 0.0 280 KB

Use CodeMirror with Rails 3

Home Page: https://rubygems.org/gems/codemirror-rails

License: MIT License

Ruby 96.51% JavaScript 3.49%

codemirror-rails's Introduction

codemirror-rails

Wire up the CodeMirror assets for your Rails applications.

Getting Started

If you're using Bundler, you can add codemirror-rails to your Gemfile:

gem 'codemirror-rails'

Or manually install the codemirror-rails gem:

gem install codemirror-rails

CodeMirror for Rails 3.1

All of the assets from the most latest stable CodeMirror release are vendored so that you can use them with the asset pipeline. At a minimum, you will probably want the following in your application.js and application.css:

//= require codemirror

Adding a mode

Additional syntax modes can be added to your application.js:

//= require codemirror/modes/ruby

Adding a util

Additional reusable util components can be added in your application.js:

//= require codemirror/utils/dialog

Adding a keymap

Additional keymap bindings can be added to your application.js:

//= require codemirror/keymaps/vim

Adding a theme

Additional CSS themes can be added to your application.css

//= require codemirror/themes/night

CodeMirror for Rails 3

You can use the generator included with this gem to copy the CodeMirror 2 assets into your Rails 3 public directory.

rails generate codemirror:install

codemirror-rails's People

Contributors

fixlr avatar sebastianmaier avatar kennyadsl avatar jweir avatar

Stargazers

 avatar

Watchers

James Cloos avatar  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.