module Tilt

Namespace for Tilt. This module is not intended to be included anywhere.

Constants

AsciidoctorTemplate

Asciidoctor implementation for AsciiDoc see: asciidoctor.github.com/

Asciidoctor is an open source, pure-Ruby processor for converting AsciiDoc documents or strings into HTML 5, DocBook 4.5 and other formats.

BabelTemplate
CommonMarkerTemplate
CreoleTemplate

Creole implementation. See: www.wikicreole.org/

EMPTY_ARRAY
EMPTY_HASH
HamlTemplate

Haml >= 6 ships its own template, prefer it when available.

KramdownTemplate

Kramdown Markdown implementation. See: kramdown.gettalong.org/

LOCK

@private

LiveScriptTemplate

LiveScript template implementation. See: livescript.net/

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

PandocTemplate

Pandoc markdown implementation. See: pandoc.org/

PlainTemplate

Raw text (no template functionality).

RDiscountTemplate

Discount Markdown implementation. See: github.com/rtomayko/rdiscount

RDiscount is a simple text filter. It does not support scope or locals. The :smart and :filter_html options may be set true to enable those flags on the underlying RDiscount object.

RDocTemplate

RDoc template. See: github.com/ruby/rdoc

RedClothTemplate

RedCloth implementation. See: github.com/jgarber/redcloth

RedcarpetTemplate
RstPandocTemplate

Pandoc reStructuredText implementation. See: # pandoc.org/

SlimTemplate
TOPOBJECT

@private

TypeScriptTemplate
VERSION

Current version.

Attributes

default_mapping[R]

@return [Tilt::Mapping] the main mapping object

extract_fixed_locals[RW]

Whether to extract fixed locals from templates by scanning the template content.

Public Class Methods

[](file) click to toggle source

@see Tilt::Mapping#[]

   # File lib/tilt.rb
75 def self.[](file)
76   @default_mapping[file]
77 end
finalize!() click to toggle source

Replace the default mapping with a finalized version of the default mapping. This can be done to improve performance after the template libraries you desire to use have already been loaded. Once this is is called, all attempts to modify the default mapping will fail. This also freezes Tilt itself.

   # File lib/tilt.rb
24 def self.finalize!
25   return self if @default_mapping.is_a?(FinalizedMapping)
26 
27   class << self
28     prepend(Module.new do
29       def lazy_map(*)
30         raise "Tilt.#{__callee__} not supported after Tilt.finalize! has been called"
31       end
32       alias register lazy_map
33       alias register_lazy lazy_map
34       alias register_pipeline lazy_map
35       alias prefer lazy_map
36     end)
37   end
38 
39   @default_mapping = @default_mapping.finalized
40 
41   freeze
42 end
lazy_map(*) click to toggle source
   # File lib/tilt.rb
29 def lazy_map(*)
30   raise "Tilt.#{__callee__} not supported after Tilt.finalize! has been called"
31 end
new(file, line=nil, options=nil, &block) click to toggle source

@see Tilt::Mapping#new

   # File lib/tilt.rb
70 def self.new(file, line=nil, options=nil, &block)
71   @default_mapping.new(file, line, options, &block)
72 end
prefer(*)

Alias register as prefer for Tilt 1.x compatibility.

Alias for: lazy_map
register(*)
Also aliased as: prefer
Alias for: lazy_map
register_lazy(*)
Alias for: lazy_map
register_pipeline(*)
Alias for: lazy_map
registered?(ext) click to toggle source

@see Tilt::Mapping#registered?

   # File lib/tilt.rb
65 def self.registered?(ext)
66   @default_mapping.registered?(ext)
67 end
template_for(file) click to toggle source

@see Tilt::Mapping#template_for

   # File lib/tilt.rb
80 def self.template_for(file)
81   @default_mapping.template_for(file)
82 end
templates_for(file) click to toggle source

@see Tilt::Mapping#templates_for

   # File lib/tilt.rb
85 def self.templates_for(file)
86   @default_mapping.templates_for(file)
87 end