Build Status

highlightjs-rails

A gemified version of the awesome highlight.js library.

Installation

Add this line to your application's Gemfile:

gem 'highlightjs-rails'

And then execute:

$ bundle

Or install it yourself as:

$ gem install highlightjs-rails

Usage

The highlight.js files will be added to the asset pipeline and available for you to use. Add these lines to application.js:

//= require highlight

and to application.css:

*= require styles/github

The bare minimum for using highlight.js on a web page is linking to the library along with one of the styles and calling initHighlightingOnLoad:

hljs.initHighlightingOnLoad();

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/rezajatnika/highlightjs-rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

A couple of notes:

  • If it's an issue pertaining to the highlight.js javascript, please report it to the highlight.js project.
  • If the highlight.js scripts are outdated, feel free to open an issue and prod us to get that thing updated.

License

The gem is available as open source under the terms of the MIT License.

Acknowledgements

This README is heavily inspired by the one for jquery-rails.