Module: Webgen::ContentProcessor::Scss

Defined in:
lib/webgen/content_processor/scss.rb

Overview

Processes content in sassy CSS markup (used for writing CSS files) using the sass library.

Class Method Summary collapse

Class Method Details

.call(context) ⇒ Object

Convert the content in scss markup to CSS.



12
13
14
15
16
17
18
# File 'lib/webgen/content_processor/scss.rb', line 12

def self.call(context)
  options = Webgen::ContentProcessor::Sass.default_options(context).merge(:syntax => :scss)
  context.content = ::Sass::Engine.new(context.content, options).render
  context
rescue ::Sass::SyntaxError => e
  raise Webgen::RenderError.new(e, 'content_processor.scss', context.dest_node, nil, (e.sass_line if e.sass_line))
end