Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update docs with better examples
  • Loading branch information
alexdunae committed Feb 27, 2010
1 parent e93c7b7 commit c828bcc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.rdoc
Expand Up @@ -15,7 +15,13 @@ Done.
include CssParser

parser = CssParser::Parser.new
parser.load_file!('http://example.com/styles/style.css')
parser.load_uri!('http://example.com/styles/style.css')

# load a remote file, setting the base_uri and media_types
parser.load_uri!('../style.css', 'http://example.com/styles/inc/', [:screen, :handheld])

# load a local file, setting the base_dir and media_types
parser.load_file!('print.css', '~/styles/', :print)

# lookup a rule by a selector
parser.find('#content')
Expand All @@ -28,7 +34,7 @@ Done.
parser.each_selector(:screen) do |selector, declarations, specificity|
...
end

# add a block of CSS
css = <<-EOT
body { margin: 0 1em; }
Expand Down

0 comments on commit c828bcc

Please sign in to comment.