Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sbfaulkner-kulriir

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sbfaulkner-kulriir

  • 1.0.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

kulriir

Syntax highlighting using the kulrii.heroku.com web service.

WHY?

I have historically used ultraviolet for any syntax highlighting. However, in order to use ultraviolet, you need to be able to use the oniguruma library. Unfortunately, some hosting services (like the Media Temple grid service) do not support this library. I needed another solution, and it seemed like something that could be outsourced... the only solution I found seemed to be the pygment.com javascript-based solution. I cobbled together my pygmalion gem, which does the job, but it seemed I could do something myself that didn't rely on an undocumented api.

Installation

Run the following if you haven't already:

$ gem sources -a http://gems.github.com

Install the gem(s):

$ sudo gem install -r sbfaulkner-kulriir

Usage

In ruby...

require 'kulriir'
...
string.highlight
string.highlight(:syntax => 'javascript')
string.highlight(:syntax => 'ruby', :numbers => true)

From the command-line...

Usage: kulriir [options] [file ...]

Options:
    -h, --help              Display this message.
    -n, --numbers           Include line numbers.
    -S, --syntaxes          List all supported syntaxes.
    -s, --syntax=name       The language for the code to be highlighted.
    -T, --themes            List all supported themes.
    -t, --theme=name        The theme to use for code highlighting.

Example

File.read('hello.rb').highlight(:numbers => true)

Results in...

<pre class="mac_classic"><span class="line-numbers">   1 </span> <span class="Keyword">def</span> <span class="FunctionName">hello</span>
<span class="line-numbers">   2 </span>   puts <span class="String"><span class="String">&quot;</span>hello<span class="String">&quot;</span></span>
<span class="line-numbers">   3 </span> <span class="Keyword">end</span>
</pre>

Author: S. Brent Faulkner brentf@unwwwired.net
License: Copyright © 2008 unwwwired.net, released under the MIT license

FAQs

Package last updated on 10 Aug 2014

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc