Skip to content

v-pukman/medium-editor-markdown-plugin

Repository files navigation

Markdown Plugin for Rails

This gem integrates Medium Editor Markdown Plugin with Rails asset pipeline.

Version

The latest version of plugin bundled by this gem is v2.6.1

Installation

Include medium-editor-markdown-plugin in your Rails project's Gemfile:

gem 'medium-editor'
gem 'medium-editor-markdown-plugin'

Configuration

Include javascript file in app/assets/javascripts/application.js:

//= require medium-editor
//= require medium-editor-markdown-plugin

Using plugin with Medium Editor

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>

Contributing

  1. Fork it ( https://github.com/mwlang/medium-editor-markdown-plugin/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages