You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

syntax-highlighter-rails

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

syntax-highlighter-rails

3.0.83.1.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

Syntax-Highlighter-Rails

A rails gem to display your code properly on webpages using SyntaxHighlighter

Installation

Add this line to your application's Gemfile:

gem 'syntax-highlighter-rails'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install syntax-highlighter-rails

Usage

To highlight a code snippet (cpp for example) symply use the tag :

<pre class="brush: cpp">
    // Your code here
</pre>

Add the following to a javascript file :

//= require syntax-highlighter-rails/shCore
//= require syntax-highlighter-rails/shBrushCpp

Available brushes can be found here

In your page, don't forget to call :

SyntaxHighlighter.all()

Add the following to one of your css files :

 *= require syntax-highlighter-rails/shCore
 *= require syntax-highlighter-rails/shThemeDefault

Note : You can modify the theme by replacing shThemeDefault by one of the following

FAQs

Package last updated on 04 Sep 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts