Permalink
Browse files

Improve the documentation and include screenshot

  • Loading branch information...
1 parent 8f3031a commit a65b6994d28b072f5ada9c4f24fe37ddb80719db Gareth Rees committed Sep 28, 2011
Showing with 33 additions and 7 deletions.
  1. +33 −7 README.md
View
@@ -5,14 +5,40 @@
I use [iA Writer](http://iawriter.com "iA Writer") and find the *estimated reading time* feature pretty handy. I thought it would be cool to add at the top of my blog articles on the web as [others](http://nicepaul.com "The personal blog of @nicepaul") do.
-Full credit goes to [Brian Cray](http://briancray.com/2010/04/09/estimated-reading-time-web-design "Brian Cray - Estimated Reading Time in Web Design") for explaining how to do it in PHP.
-
## How to Use
-[readingtime](http://github.com/garethrees/readingtime "Gem to estimate reading time") extends the Ruby String class, so you can call `reading_time` on any string object.
+[readingtime](http://github.com/garethrees/readingtime "Gem to estimate reading time") extends the Ruby String class, so you can call `reading_time` on any `String` object.
+
+### Install
+
+ gem install readingtime
+
+### In irb
+
+ $ irb
+ > require 'readingtime'
+ => true
+ > @words = "Lorem ipsum dolor sit amet"
+ > @words.reading_time
+ => "0:01"
+
+### In Your App
+
+ <article>
+
+ <header>
+ <h1><%= @article.title %></h1>
+ <span class="readingtime">Estimated reading time – <%= @article.body.reading_time %></span>
+ </header>
+
+ <%= @article.body %>
+
+ </article>
+
+And voila!
+
+![Screenshot of readingtime in use](https://github-screenshots.s3.amazonaws.com/readingtime-view.png "Screenshot of readingtime in use")
-### Example
+## Thanks
- @words = "Lorem ipsum dolor sit amet"
- @words.reading_time
- => "0:01"
+Credit goes to [Brian Cray](http://briancray.com/2010/04/09/estimated-reading-time-web-design "Brian Cray - Estimated Reading Time in Web Design") for explaining how to do it in PHP.

0 comments on commit a65b699

Please sign in to comment.