Tool to Convert External CSS to Inline CSS in Ruby? [closed]
Asked Answered
B

3

7

I am messing around with GoogleDocs and it has very very primitive CSS support. If you upload an MSWord .doc or an HTML file and export it as HTML, all styles are applied inline. They have a style block in the html file, but when you upload the HTML file back to google docs, it doesn't apply any non-inline styles.

So I was thinking "maybe there's a ruby tool for this". Is there anything out there I could use to take some CSS and have it parse it into the HTML nodes, maybe some nokogiri plugin?

Bev answered 16/2, 2010 at 11:31 Comment(0)
R
5

Check out alexdunae's Premailer on GitHub: http://github.com/alexdunae/premailer

Never tried it by myself, just stumbled upon. Maybe it helps.

Refraction answered 16/2, 2010 at 14:14 Comment(2)
this also looks great, but is not rails-integrated (just for those out there who are looking for that).Jackknife
I use Premailer at putsmail.com, it works like a charm. You can test it online.Translative
G
2

MailStyle is another solution: http://github.com/purify/mail_style

Looks like it has easy rails integration (actionmailer, sass), but I'm not sure that's what you are/were looking for.

Garibald answered 8/7, 2010 at 1:44 Comment(1)
this looks great, and integrates with railsJackknife
K
1

Ruby Toolbox has a list of even more options. Premailer is the most used, though Roadie has been updated more recently.

Koralle answered 13/6, 2013 at 17:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.