Module: Crass
- Defined in:
- lib/crass.rb,
lib/crass/parser.rb,
lib/crass/scanner.rb,
lib/crass/version.rb,
lib/crass/tokenizer.rb,
lib/crass/token-scanner.rb
Overview
A CSS parser based on the CSS Syntax Module Level 3 draft.
Defined Under Namespace
Classes: Parser, Scanner, TokenScanner, Tokenizer
Constant Summary collapse
- VERSION =
'0.1.0'
Class Method Summary collapse
-
.parse(input, options = {}) ⇒ Object
Parses input as a CSS stylesheet and returns a parse tree.
-
.parse_properties(input, options = {}) ⇒ Object
Parses input as a string of CSS properties (such as the contents of an HTML element's
styleattribute) and returns a parse tree.
Instance Method Summary collapse
-
#string ⇒ Object
Returns the string being scanned.
Class Method Details
.parse(input, options = {}) ⇒ Object
Parses input as a CSS stylesheet and returns a parse tree.
See Crass::Tokenizer#initialize for options.
10 11 12 |
# File 'lib/crass.rb', line 10 def self.parse(input, = {}) Parser.parse_stylesheet(input, ) end |
.parse_properties(input, options = {}) ⇒ Object
Parses input as a string of CSS properties (such as the contents of an
HTML element's style attribute) and returns a parse tree.
See Crass::Tokenizer#initialize for options.
18 19 20 |
# File 'lib/crass.rb', line 18 def self.parse_properties(input, = {}) Parser.parse_properties(input, ) end |
Instance Method Details
#string ⇒ Object
Returns the string being scanned.
121 122 123 |
# File 'lib/crass/scanner.rb', line 121 def string @scanner.string end |