Coder Social home page Coder Social logo

wysihtml5_gem's Introduction

wysihtml5_gem

=============

A quick and simple gem to wrap and install wysihtml5 into a rails asset pipeline. This gem will not create the tool bar, but this is very easily done and gives you all the flexibility to add it yourself styling it anyway you like.

This gem is intended to be as clean as possible and versions of this gem will stay in line with versions of the wysihtml5

Installation for Rails 3.1 and above

Add the gem to your Gemfile

gem 'wysihtml5_gem', '0.3.0'

save and run bundle install.

Configuration into your rails application

In application.js add the following (I personally use coffescript)

//= require wysihtml5_gem/wysihtml5-0.3.0
//= require wysihtml5_gem/advanced

In application.css add the following (I use sass notation here)

@import "wysihtml5_gem/wysihtml5"

Then just simple add the wysihtml5 class name to a text area and initialize wysihtml5 (I am using HAML notation here with a rails for helper)

= text_area_tag :testing_wysihtml5, "", :class => "wysihtml5"

or in pure html

<textarea id="testing_wysihtml5" class="wysihtml5"></textarea>

the simple initialise the wysihtml5

  var editor = new wysihtml5.Editor("testing_wysihtml5", {    // id of textarea element
    //toolbar:      "wysihtml5-toolbar",                      // id of toolbar element, which you need to create
    parserRules:  wysihtml5ParserRules                        // defined in parser rules set 
  });

Copyright (c) 2012 HouseKeeper. See LICENSE.txt for further details.

wysihtml5_gem's People

Contributors

housekeeper avatar

Watchers

 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.