File: examples.rb

package info (click to toggle)
ruby-compass 0.12.2~dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 8,308 kB
  • sloc: ruby: 10,474; makefile: 42; xml: 14
file content (21 lines) | stat: -rw-r--r-- 606 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
def example_haml
  markup_item = @item.children.detect{|child| child.identifier =~ /markup/}
  markup_item.reps.find { |r| r.name == :default }.content_at_snapshot(:raw)
end

def example_html
  Haml::Engine.new(example_haml).render
end

def example_sass
  markup_item = @item.children.detect{|child| child.identifier =~ /stylesheet/}
  markup_item.reps.find { |r| r.name == :default }.content_at_snapshot(:raw)
end

def example_scss
  Sass::Engine.new(example_sass).to_tree.to_scss
end

def example_css
  Sass::Engine.new(example_sass, Compass.sass_engine_options.merge(:line_comments => false)).render
end