Generates valid CSS from CSS-like input, supporting variables, nesting and mixins.
Convert the content in context to valid CSS.
# File lib/webgen/contentprocessor/less.rb, line 11 11: def call(context) 12: require 'less' 13: context.content = ::Less.parse(context.content) 14: context 15: rescue LoadError 16: raise Webgen::LoadError.new('less', self.class.name, context.dest_node, 'less') 17: rescue ::Less::SyntaxError => e 18: line = e.message.scan(/on line (\d+):/).first.first.to_i rescue nil 19: raise Webgen::RenderError.new(e, self.class.name, context.dest_node, context.ref_node, line) 20: rescue ::Less::MixedUnitsError => e 21: raise Webgen::RenderError.new("Can't mix different units together: #{e}", 22: self.class.name, context.dest_node, context.ref_node) 23: rescue ::Less::VariableNameError => e 24: raise Webgen::RenderError.new("Variable name is undefined: #{e}", 25: self.class.name, context.dest_node, context.ref_node) 26: rescue ::Less::MixinNameError => e 27: raise Webgen::RenderError.new("Mixin name is undefined: #{e}", 28: self.class.name, context.dest_node, context.ref_node) 29: rescue ::Less::ImportError => e 30: raise Webgen::RenderError.new(e, self.class.name, context.dest_node, context.ref_node) 31: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.