Module: Webgen::ContentProcessor::Sass
- Defined in:
- lib/webgen/content_processor/sass.rb
Overview
Processes content in Sass markup (used for writing CSS files).
Defined Under Namespace
Classes: FileSystemImporter, NodeTreeImporter
Class Method Summary collapse
-
.call(context) ⇒ Object
Convert the content in
sass
markup to CSS. -
.default_options(context) ⇒ Object
:nodoc:.
Class Method Details
.call(context) ⇒ Object
Convert the content in sass
markup to CSS.
132 133 134 135 136 137 |
# File 'lib/webgen/content_processor/sass.rb', line 132 def self.call(context) context.content = ::Sass::Engine.new(context.content, (context)).render context rescue ::Sass::SyntaxError => e raise Webgen::RenderError.new(e, 'content_processor.sass', context.dest_node, nil, (e.sass_line if e.sass_line)) end |
.default_options(context) ⇒ Object
:nodoc:
139 140 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/webgen/content_processor/sass.rb', line 139 def self.(context) # :nodoc: opts = context.website.config['content_processor.sass.options'] load_paths = context.website.ext.sass_load_paths + [NodeTreeImporter.new(context)] opts.merge({ :filename => context.ref_node.alcn, :syntax => :sass, :cache_store => ::Sass::CacheStores::Filesystem.new(context.website.tmpdir('content_processor.sass')), :filesystem_importer => FileSystemImporter, :load_paths => load_paths, :webgen_context => context }) end |