Class: Webgen::ContentProcessor::Sass

Inherits:
Object
  • Object
show all
Defined in:
lib/webgen/contentprocessor/sass.rb

Overview

Processes content in Sass markup (used for writing CSS files) using the haml library.

Instance Method Summary collapse

Instance Method Details

#call(context) ⇒ Object

Convert the content in sass markup to CSS.



9
10
11
12
13
14
15
16
# File 'lib/webgen/contentprocessor/sass.rb', line 9

def call(context)
  require 'sass'

  context.content = ::Sass::Engine.new(context.content, :filename => context.ref_node.alcn).render
  context
rescue Exception => e
  raise RuntimeError, "Error converting Sass markup to CSS in <#{context.ref_node.alcn}>: #{e.message}", e.backtrace
end