= CSS Inliner CSS Inliner is a command-line tools to inline CSS into style attribute of each HTML element. HTML here...
This is sample HTML document. In this paragraph, text is black and line has double height of font size.
... becomes like this:This is sample HTML document. In paragraph, text is black and line height is twice of font size.
= INSTALL == As a RubyGem $ gem install css_inliner == From Repository $ git clone git://gitorious.org/css_inliner/css_inliner.git $ cd css_inliner $ rake install = USAGE == As Command-Line Tools Note that options are not stable. === css-inliner $ css-inliner --help $ css-inliner file1.html(output to stdout) $ css-inliner file2.html > result2.html $ css-inliner file3.html --output=result3.html $ css-inliner file4.html --element=body(output only body element) $ css-inliner file5.html --in-place(overwrite file5.html) $ css-inliner file6.html --in-place=.bak(create a backup file as file6.html.bak) === css-inliner-multifile $ css-inliner --help $ css-inliner-multifile ./dir1/*.html(output all result to standard output) $ css-inliner-multifile ./dir2/*.html --dir=./resultdir $ css-inliner-multifile ./dir3/*.html --element=body $ css-inliner-multifile ./dir4/*.html --in-place=.bak == As a Library Note that this is not stable at all. require 'css_inliner' html = File.read(sample.html) CSSInliner.process html, '.' # => CSS-inlined HTML CSSInliner.process html, '.', 'body' # => body element( ... ) CSSInliner.process html, '.', 'article' # => The first article element CSSInliner.process html, 'http://example.net/stylesheets' # Passed URI will be used as base directory when resolving relative URI of CSS == Note Note that and will be removed in process. = LICENSE CSS Inliner is copyright (c) 2011, 2012 KITAITI Makoto. Distribued under the MIT license, see LISENCE file for the term.