Permalink
Browse files

Update README to detail Premailer object options customization

  • Loading branch information...
1 parent 86ffdea commit f9c32eece84a487b4115353720089373ca406c78 @simeonwillbanks simeonwillbanks committed Dec 8, 2011
Showing with 27 additions and 0 deletions.
  1. +27 −0 README.md
View
@@ -37,3 +37,30 @@ Simply add the gem to your Gemfile in your Rails project:
gem 'premailer-rails3'
That's it!
+
+## Customization
+
+The [Premailer object](https://github.com/alexdunae/premailer/blob/master/lib/premailer/premailer.rb) has many options. Refer to its documentation for
+details. premailer-rails3 sets a couple options.
+
+ options = {
+ :with_html_string => true,
+ :css_string => CSSHelper.css_for_doc(doc)
+ }
+
+If you'd like to add to or change these options, just add an initializer
+to your app.
+
+ # config/initializers/premailer-rails3.rb
+ module PremailerRails
+ module Options
+ extend self
+ def custom
+ {:preserve_styles => true}
+ end
+ end
+ end
+
+The PremailerRails::Options#custom hash will be merged (using `merge!`)
+with the premailer-rails3 options before instantiating the Premailer
+object.

0 comments on commit f9c32ee

Please sign in to comment.