Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
austinbv committed Aug 3, 2011
1 parent 775dd02 commit 6ee2507
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
30 changes: 16 additions & 14 deletions README → README.md
@@ -1,18 +1,19 @@
== Welcome
## Welcome ##

http://pygments.appspot.com is an unofficial API for the Pygments syntax highlighting library, version 1.2.
It's designed to provide syntax highlighting for web applications that don't have Python installed.
http://pygments-1-4.appspot.com is an unofficial API for the Pygments syntax highlighting library, version 1.4.
It's designed to provide syntax highlighting for web applications that don't have Python installed.

== Usage
The origional was forked from trevorturk and updated to work with newer versions of Pygments.

POST to http://pygments.appspot.com with "lang" and "code" parameters in the body.
You'll receive pygmentized HTML back, which you can store for later display on your site.
You can style the pygmentized HTML using CSS like this: http://github.com/trevorturk/pygments/blob/master/default.css
## Usage ##

== Ruby Example
POST to http://pygments-1-4.appspot.com with "lang" and "code" parameters in the body.
You'll receive pygmentized HTML back, which you can store for later display on your site.
You can style the pygmentized HTML using CSS like this: http://github.com/austinbv/pygments/blob/master/default.css

$ irb
## Ruby Example ##

```ruby
require 'net/http'
require 'uri'

Expand All @@ -21,19 +22,20 @@ code = 'print "Hello World"'

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

== More Information
## More Information ##

This site was created so that http://flowcoder.com could run on http://heroku.com, but please feel free to use it yourself.
If you like, you can fork the code on github and create your own Google App Engine site, though.
If you like, you can fork the code on github and create your own Google App Engine site, though.

Visit http://pygments.org/ for more information about Pygments.
Visit http://pygments.org/ for more information about Pygments.
Visit http://github.com/richleland/pygments-css for more example CSS files for use with Pygments.
Visit http://github.com/trevorturk/pygments for more information about this site, and to see the source code.
Visit http://github.com/trevorturk/pygments for more information about this site, and to see the source code.

See also: http://www.hilite.me/ for a similar application with more options.

== MIT License
## MIT License ##

Copyright (c) 2009 Trevor Turk

Expand Down
2 changes: 1 addition & 1 deletion app.py
Expand Up @@ -8,7 +8,7 @@
class App(webapp.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.out.write(open('README', 'r').read())
self.response.out.write(open('README.md', 'r').read())
def post(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.out.write(pygmentize(self.request.get("lang"), self.request.get("code")))
Expand Down

0 comments on commit 6ee2507

Please sign in to comment.