New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rack-pygments

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rack-pygments

  • 0.4
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

Rack::Pygments

A rack middleware for Pygments, the syntax highlighter

It will work with any rack based app and Rails app.

Requirements:

  • Rack (http://rack.rubyforge.org)
  • Pygments (http://pygments.org/)
  • Nokogiri (http://nokogiri.org/)

Install Nokogiri:

sudo gem install nokogiri -s http://gemcutter.org/

Install Pygments:

easy_install pygments

Install Rack::Pygments

sudo gem install rack-pygments -s http://gemcutter.org/

Options (OPTIONAL):

:html_tag - set html tag (default: highlight)

Example #1: :html_tag => "hl:code" #=> <hl:code lang="bash"></hl:code> Example #2: :html_tag => "colorful" #=>

:html_attr - set html tag's attribute (default: lang)

Example #1: :html_attr => "style" #=> Example #2: :html_attr => "lexer" #=>

Example:

config.ru:

require "app" require "rack/pygments"

use Rack::Pygments, :html_tag => "highlight", :html_attr => "lang"

run Sinatra::Application

app.rb:

require "sinatra"

get "/" do erb :colorme end

END

@@colorme

def hello(name)
  puts "Hello #{name.capitalize}!"
end
def hello(name):
    print "Hello %s!" % name

FAQs

Package last updated on 25 Jul 2010

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