Idecoder gem
Idecoder was created for developers building web applications with coding editors. Idecoder.js provides a plugin that gives the developer a screen inside their own app to give the users a way to develop codes.
Installation
Add this line to your application's Gemfile:
gem 'idecoder'
And then execute:
$ bundle
Or install it yourself as:
$ gem install idecoder
Usage
Simply add the render_idecoder helper method to your Rails layout or to any specific page you wish.
<html>
<head>...</head>
<body>
<h1>My Content</h1>
...
<%= render_idecoder %>
</body>
</html>
To add options to the Idecoder plugin, simply pass them as a Hash to the helper method:
# Switching to Haml
html
head
... something ...
body
h1 Any content
... something ...
= render_idecoder {language: 'sql', read_only: 'false'}
If you wish to have Idecoder in your production and/or staging environment, pass the last argument of false:
= render_idecoder {language: 'ruby', read_only: 'false'}, <i style='color: #c00'>false</i>
Options
| Value | Default | Description |
|---|---|---|
| language | ruby | See Language Options List |
| theme | monokai | See Themes Options List |
| height | 300px | Canvas height |
| width | 90% | Canvas width |
| border | '1px solid lightgray' | Border style |
| read_only | true | Does not allow the user to make changes in databases |
Language Options
| Value | Description |
|---|---|
| abap | ABAP Language |
| asciidoc | AsciiDoc Language |
| c_cpp | C / C++ |
| coldfusion | Cold Fusion |
| csharp | C Sharp |
| css | CSS |
| dart | Dart Language |
| dot | .Net |
| haml | HAML |
| java | Java Language |
| javascript | Javascript |
| json | Json |
| objectivec | Objective C |
| perl | Perl |
| pgsql | Language for PostgreSQL |
| php | PHP |
| python | Python Language |
| ruby | Ruby Language |
| sql | SQL Scripts |
| typescript | TypeScript |
| xml | XML |
| yaml | YAML |
Theme Options
| Value | Description |
|---|---|
| ambiance | Ambiance |
| chaos | Chaos |
| chrome | Chrome |
| clouds | Clouds |
| clouds_midnight | Clouds Midnight |
| cobalt | Cobalt |
| crimson_editor | Crimson Editor |
| dawn | Dawn |
| dreamweaver | Dreamweaver |
| eclipse | Eclipse |
| github | Github |
| idle_fingers | Idle Fingers |
| kr | KR |
| merbivore | Merbivore |
| merbivore_soft | Merbivore Soft |
| mono_industrial | Mono Industrial |
| monokai | Monokai |
| pastel_on_dark | Pastel On Dark |
| solarized_dark | Solarized Dark |
| solarized_light | Solarized Dark |
| textmate | TextMate |
| tomorrow | Tomorrow |
| tomorrow_night | Tomorrow Night |
| tomorrow_night_blue | Tomorrow Night Blue |
| tomorrow_night_bright | Tomorrow Night Bright |
| tomorrow_night_eighties | Tomorrow Night Eighties |
| twillight | Twillight |
| vibrant_ink | Vibrant Ink |
| xcode | XCode |
Dependencies
Marx.Idecoder has a dependency on:
- jQuery version >= 1.10.x
- JQuery Ace Rails 1.0.1
Contributing
- Fork it ( https://github.com/popolin/idecoder/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request