Module: Tilt

Defined in:
lib/tilt.rb,
lib/tilt/erb.rb,
lib/tilt/csv.rb,
lib/tilt/less.rb,
lib/tilt/rdoc.rb,
lib/tilt/yajl.rb,
lib/tilt/haml.rb,
lib/tilt/sass.rb,
lib/tilt/plain.rb,
lib/tilt/liquid.rb,
lib/tilt/radius.rb,
lib/tilt/coffee.rb,
lib/tilt/etanni.rb,
lib/tilt/erubis.rb,
lib/tilt/string.rb,
lib/tilt/creole.rb,
lib/tilt/maruku.rb,
lib/tilt/markaby.rb,
lib/tilt/builder.rb,
lib/tilt/mapping.rb,
lib/tilt/asciidoc.rb,
lib/tilt/nokogiri.rb,
lib/tilt/redcloth.rb,
lib/tilt/template.rb,
lib/tilt/kramdown.rb,
lib/tilt/rdiscount.rb,
lib/tilt/redcarpet.rb,
lib/tilt/bluecloth.rb,
lib/tilt/wikicloth.rb

Overview

AsciiDoc see: asciidoc.org/

Defined Under Namespace

Classes: AsciidoctorTemplate, BlueClothTemplate, BuilderTemplate, CSVTemplate, Cache, CoffeeScriptTemplate, CreoleTemplate, ERBTemplate, ErubisTemplate, EtanniTemplate, HamlTemplate, KramdownTemplate, LessTemplate, LiquidTemplate, Mapping, MarkabyTemplate, MarukuTemplate, NokogiriTemplate, PlainTemplate, RDiscountTemplate, RDocTemplate, RadiusTemplate, RedClothTemplate, Redcarpet1Template, Redcarpet2Template, RedcarpetTemplate, SassTemplate, ScssTemplate, StringTemplate, Template, WikiClothTemplate, YajlTemplate

Constant Summary

VERSION =

Current version.

'2.0.0.beta1'
TOPOBJECT =
Object.superclass || Object
LOCK =
Mutex.new

Class Method Summary (collapse)

Class Method Details

+ (Object) [](file)

See Also:



47
48
49
# File 'lib/tilt.rb', line 47

def self.[](file)
  default_mapping[file]
end

+ (Object) current_template

Note:

This is currently an experimental feature and might return nil in the future.

Returns the template object that is currently rendering.

Examples:

tmpl = Tilt['index.erb'].new { '<%= Tilt.current_template %>' }
tmpl.render == tmpl.to_s


69
70
71
# File 'lib/tilt.rb', line 69

def self.current_template
  Thread.current[:tilt_current_template]
end

+ (Tilt::Mapping) default_mapping



12
13
14
# File 'lib/tilt.rb', line 12

def self.default_mapping
  @default_mapping
end

+ (Object) lazy_map



17
18
19
# File 'lib/tilt.rb', line 17

def self.lazy_map
  default_mapping.lazy_map
end

+ (Object) new(file, line = nil, options = {}, &block)

See Also:



42
43
44
# File 'lib/tilt.rb', line 42

def self.new(file, line=nil, options={}, &block)
  default_mapping.new(file, line, options, &block)
end

+ (Object) prefer(template_class, *extensions)

Deprecated.

Use register instead.



32
33
34
# File 'lib/tilt.rb', line 32

def self.prefer(template_class, *extensions)
  register(template_class, *extensions)
end

+ (Object) register(template_class, *extensions)



22
23
24
# File 'lib/tilt.rb', line 22

def self.register(template_class, *extensions)
  default_mapping.register(template_class, *extensions)
end

+ (Object) register_lazy(class_name, file, *extensions)



27
28
29
# File 'lib/tilt.rb', line 27

def self.register_lazy(class_name, file, *extensions)
  default_mapping.register_lazy(class_name, file, *extensions)
end

+ (Boolean) registered?(ext)



37
38
39
# File 'lib/tilt.rb', line 37

def self.registered?(ext)
  default_mapping.registered?(ext)
end

+ (Object) template_for(file)



52
53
54
# File 'lib/tilt.rb', line 52

def self.template_for(file)
  default_mapping.template_for(file)
end

+ (Object) templates_for(file)



57
58
59
# File 'lib/tilt.rb', line 57

def self.templates_for(file)
  default_mapping.templates_for(file)
end