Skip to content

rumblelabs/pygments-heroku

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

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

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages