Autolist Extension for Medium Editor
Varun Raj developed an extention that automatically converts ( 1. Space ) to ordered list and ( * Space ) to unordered list if the corresponding base extensions are enabled.
Insert Plugin for Rails
This gem integrates Medium Editor Autolist Extension with Rails asset pipeline.
Installation
Include medium_editor/insert_plugin in your Rails project's Gemfile:
gem 'medium-editor-rails'
gem 'medium-editor-autolist-rails'
And then execute:
bundle install
bundle exec rake insert_plugin:update
Configuration
Include javascript file in app/assets/javascripts/application.js:
//= require medium-editor
//= require medium-editor-autolist.min
Using Medium Editor with Rails
You need to initialize Autolist, then assign the extention in extensions
's option. for example:
<script>
var autolist = new AutoList();
var editor = new MediumEditor('.editable', {
...,
extensions: {
...,
'autolist': autolist
},
});
</script>
Restart your app.
Contributing
- Fork it ( https://github.com/imamulakhyar93/medium-editor-autolist-rails/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