Class: Tilt::LessTemplate

### Home Classes Methods

### In Files

- lib/tilt/css.rb

### Parent

Template

### Methods

- ::engine_initialized?
- #allows_script?
- #evaluate
- #initialize_engine
- #prepare

### Class/Module Index

Quicksearch

- Tilt
- Tilt::AsciidoctorTemplate
- Tilt::BlueClothTemplate
- Tilt::BuilderTemplate
- Tilt::CSVTemplate
- Tilt::Cache
- Tilt::CoffeeScriptTemplate
- Tilt::CompileSite
- Tilt::CreoleTemplate
- Tilt::ERBTemplate
- Tilt::ErubisTemplate
- Tilt::EtanniTemplate
- Tilt::HamlTemplate
- Tilt::KramdownTemplate
- Tilt::LessTemplate
- Tilt::LiquidTemplate
- Tilt::MarkabyTemplate
- Tilt::MarukuTemplate
- Tilt::NokogiriTemplate
- Tilt::PlainTemplate
- Tilt::RDiscountTemplate
- Tilt::RDocTemplate
- Tilt::RadiusTemplate
- Tilt::RedClothTemplate
- Tilt::RedcarpetTemplate
- Tilt::RedcarpetTemplate::Redcarpet1
- Tilt::RedcarpetTemplate::Redcarpet2
- Tilt::SassTemplate
- Tilt::ScssTemplate
- Tilt::StringTemplate
- Tilt::Template
- Tilt::WikiClothTemplate
- Tilt::YajlTemplate

No matching classes.

# Tilt::LessTemplate

Lessscss template implementation. See: lesscss.org/

Less templates do not support object scopes, locals, or yield.

### Public Class Methods

engine_initialized?() click to toggle source

    # File lib/tilt/css.rb, line 54
    def self.engine_initialized?
      defined? ::Less
    end

### Public Instance Methods

allows_script?() click to toggle source

    # File lib/tilt/css.rb, line 75
    def allows_script?
      false
    end

evaluate(scope, locals, &block) click to toggle source

    # File lib/tilt/css.rb, line 71
    def evaluate(scope, locals, &block)
      @output ||= @engine.to_css(options)
    end

initialize_engine() click to toggle source

    # File lib/tilt/css.rb, line 58
    def initialize_engine
      require_template_library 'less'
    end

prepare() click to toggle source

    # File lib/tilt/css.rb, line 62
    def prepare
      if ::Less.const_defined? :Engine
        @engine = ::Less::Engine.new(data)
      else
        parser  = ::Less::Parser.new(options.merge :filename => eval_file, :line => line)
        @engine = parser.parse(data)
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.