Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pygments-heroku

http://pygmentize.herokuapp.com is an HTTP API for the syntax highligher Pygments.

API

Issue a HTTP POST request to the service running at http://pygmentize.herokuapp.com

**POST**: http://pygmentize.herokuapp.com
          PARAMS {:lang => "html", :code => "<h1>Hello World</h1>"}

The response body will contain the pygmentized HTML.

Examples

curl

curl --data "lang=html&code=<h1>Hello World</h1>" http://pygmentize.herokuapp.com

Ruby

require 'net/http'
require 'uri'

lang = 'python'
code = 'print "Hello World"'

request = Net::HTTP.post_form(URI.parse('http://pygmentize.herokuapp.com'), {'lang'=>lang, 'code'=>code})
puts request.body

Server

Dependencies

easy_install pip
pip install virtualenv

Usage

git@github.com:rumblelabs/pygments-heroku.git
cd heroku-pygments
virtualenv --no-site-packages .
source bin/activate
bin/pip install -r requirements.txt
python app.py

Run on Heroku

heroku create my-pygments-app --stack cedar
git push heroku
heroku open

Credits

Inspired by trevorturk/pygments.

License

MIT License. Copyright 2011 Rumble Labs Ltd. rumblelabs.com

About

An HTTP API for the Pygments syntax highlighter. Built to run on Heroku.

Resources

Stars

7 stars

Watchers

10 watching

Forks

Releases

Packages

Contributors

Languages