Permalink
Browse files

Correct MD formatting for README

  • Loading branch information...
1 parent f22885b commit 4fc056656801c6c98b4291d74d13cae8fb6044b9 @samvincent committed Feb 10, 2012
Showing with 28 additions and 26 deletions.
  1. +28 −26 README.md
View
54 README.md
@@ -1,45 +1,47 @@
-= Render QR codes easily from your Rails 3 application
+# Render QR codes easily from your Rails 3 application
This gem supports rendering either SVG or PNG format.
SVG, because of it's vector nature, will scale easily when intended for print. Offering QR endpoints enables others to integrate with your service in possibly interesting ways.
-== Installation
+## Installation
Add the following to your +Gemfile+.
- gem 'rqrcode-rails3'
+ gem 'rqrcode-rails3'
If you want to use the PNG format, you will have to have *ImageMagick* installed on your system.
-You will also want to add the *mini_magick* gem to your application's +Gemfile+.
+You will also want to add the **mini_magick** gem to your application's `Gemfile`.
- gem 'mini_magick'
+ gem 'mini_magick'
-== How to use
+## How to use
In your controller actions, you could return a QR code that links to the current page like this:
- respond_to do |format|
- format.html
- format.svg { render :qrcode => request.url, :level => :l, :unit => 10 }
- format.png { render :qrcode => request.url }
- end
+```ruby
+respond_to do |format|
+ format.html
+ format.svg { render :qrcode => request.url, :level => :l, :unit => 10 }
+ format.png { render :qrcode => request.url }
+end
+```
-Options:
-
-* +:size+ – This controls how big the QR Code will be. Smallest size will be chosen by default. Set to maintain consistent size.
-* +:level* – The error correction level, can be:
- * Level :l 7% of code can be restored
- * Level :m 15% of code can be restored
- * Level :q 25% of code can be restored
- * Level :h 30% of code can be restored (default :h)
-* +:offset+ – Padding around the QR Code (e.g. 10)
-* +:unit+ – How many pixels per module (e.g. 11)
-* +:fill+ – Background color (e.g "ffffff" or :white)
-* +:color+ – Foreground color for the code (e.g. "000000" or :black)
+#### Options:
+
+* `:size` – This controls how big the QR Code will be. Smallest size will be chosen by default. Set to maintain consistent size.
+* `:level` – The error correction level, can be:
+ * Level `:l` 7% of code can be restored
+ * Level `:m` 15% of code can be restored
+ * Level `:q` 25% of code can be restored
+ * Level `:h` 30% of code can be restored (default :h)
+* `:offset` – Padding around the QR Code (e.g. 10)
+* `:unit` – How many pixels per module (e.g. 11)
+* `:fill` – Background color (e.g "ffffff" or :white)
+* `:color` – Foreground color for the code (e.g. "000000" or :black)
-== About
+## About
-This project was inspired by the first chapter in José Valim's book {Crafting Rails Applications}[http://pragprog.com/titles/jvrails/crafting-rails-applications]
+This project was inspired by the first chapter in José Valim's book [Crafting Rails Applications](http://pragprog.com/titles/jvrails/crafting-rails-applications)
-QR codes are encoded by {rqrcode}[https://github.com/whomwah/rqrcode]
+QR codes are encoded by [rqrcode](https://github.com/whomwah/rqrcode)

0 comments on commit 4fc0566

Please sign in to comment.