Readme.markdown in pizzazz-0.1.0 vs Readme.markdown in pizzazz-0.1.1

- old
+ new

@@ -1,9 +1,11 @@ # Pizzazz Pizzazz is a simple pure Ruby implementation of code coloring, but just for JSON. Basically, if you have a ruby object and want to show it converted to JSON and add HTML around it so you can color it. +[Cheddar](http://cheddarapp.com) uses this to show example output of it's API calls. [Check it out](https://cheddarapp.com/developer/lists). + ## Usage Pizzazzifing an object is simple: ``` ruby @@ -23,43 +25,24 @@ ### HTML Spans are added around various elements. Here's the classes: * `string` -* `constant` (for `true` or `false` +* `constant` (`true` or `false`) * `null` * `number` -Everything else is left alone. It is recommended to wrap the output like this: +Everything else is left alone. -``` html -<pre><%= Pizzazz.ify(object).html_safe %></pre> +If you want it wrapped in `<pre class="pizzazz">` (and call `html_safe` if possible), do the following: + +``` ruby +Pizzazz.ify_html(object) ``` -Here's my stylesheet if you're interested: +### Stylesheet -``` css -pre { - border-radius: 5px; - background: #f7f7f7; - padding: 0.5em; - margin-bottom: 2em; - border: 1px solid #ddd; -} - -.string { - color: #ee6132; -} - -.null, .number, .constant { - color: #8e75c3; -} - -.comment { - color: #999; - font-style: italic; -} -``` +If you're using the asset pipeline, you can simply require `pizzazz` to get my stylesheet. Be sure your `<pre>` has the `pizzazz` class. If you use `ify_html` it will automatically do this. ## Installation Add this line to your application's Gemfile: