File: crass.rb

package info (click to toggle)
ruby-crass 1.0.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 824 kB
  • sloc: ruby: 2,158; python: 202; makefile: 7
file content (22 lines) | stat: -rw-r--r-- 624 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# encoding: utf-8
require_relative 'crass/parser'

# A CSS parser based on the CSS Syntax Module Level 3 spec.
module Crass

  # Parses _input_ as a CSS stylesheet and returns a parse tree.
  #
  # See {Tokenizer#initialize} for _options_.
  def self.parse(input, options = {})
    Parser.parse_stylesheet(input, options)
  end

  # 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 {Tokenizer#initialize} for _options_.
  def self.parse_properties(input, options = {})
    Parser.parse_properties(input, options)
  end

end