This gem integrates Medium Editor Markdown Plugin with Rails asset pipeline.
The latest version of plugin bundled by this gem is v2.6.1
Include medium-editor-markdown-plugin in your Rails project's Gemfile:
gem 'medium-editor'
gem 'medium-editor-markdown-plugin'
Include javascript file in app/assets/javascripts/application.js:
//= require medium-editor
//= require medium-editor-markdown-plugin
Initialize Medium Editor and add Markdown Plugin inside configuration:
<div class="editable"></div>
<div class="markdown">
<pre></pre>
</div>
<script>
$(document).ready(function(){
var markdown = $(".markdown pre");
var editor = new MediumEditor('.editable', {
extensions: {
markdown: new MeMarkdown(function (md) {
markdown.html(md);
})
}
});
});
</script>
- Fork it ( https://github.com/mwlang/medium-editor-markdown-plugin/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