Class: Nanoc::Filters::Sass
- Inherits:
-
Nanoc::Filter
- Object
- Context
- Nanoc::Filter
- Nanoc::Filters::Sass
- Defined in:
- lib/nanoc/filters/sass.rb
Constant Summary
Constant Summary
Constants inherited from Nanoc::Filter
Nanoc::Filter::TMP_BINARY_ITEMS_DIR
Instance Attribute Summary
Attributes inherited from Nanoc::Filter
Instance Method Summary (collapse)
-
- (Object) imported_filename_to_item(filename)
-
- (String) run(content, params = {})
Runs the content through Sass.
Methods inherited from Nanoc::Filter
#depend_on, #filename, from_binary?, #initialize, #output_filename, requires, setup, #setup_and_run, to_binary?, type
Methods included from PluginRegistry::PluginMethods
#all, #identifier, #identifiers, #named, #register
Methods inherited from Context
Constructor Details
This class inherits a constructor from Nanoc::Filter
Instance Method Details
- (Object) imported_filename_to_item(filename)
23 24 25 26 27 28 |
# File 'lib/nanoc/filters/sass.rb', line 23 def imported_filename_to_item(filename) @items.find do |i| i.raw_filename && Pathname.new(i.raw_filename).realpath == Pathname.new(filename).realpath end end |
- (String) run(content, params = {})
Runs the content through Sass. Parameters passed to this filter will be passed on to Sass.
14 15 16 17 18 19 20 21 |
# File 'lib/nanoc/filters/sass.rb', line 14 def run(content, params = {}) = params.merge({ :nanoc_current_filter => self, :filename => @item && @item.raw_filename, }) engine = ::Sass::Engine.new(content, ) engine.render end |