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_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

Public Class Methods

[](file) click to toggle source

@see Tilt::Mapping#[]

   # File lib/tilt.rb
71 def self.[](file)
72   @default_mapping[file]
73 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
20 def self.finalize!
21   return self if @default_mapping.is_a?(FinalizedMapping)
22 
23   class << self
24     prepend(Module.new do
25       def lazy_map(*)
26         raise "Tilt.#{__callee__} not supported after Tilt.finalize! has been called"
27       end
28       alias register lazy_map
29       alias register_lazy lazy_map
30       alias register_pipeline lazy_map
31       alias prefer lazy_map
32     end)
33   end
34 
35   @default_mapping = @default_mapping.finalized
36 
37   freeze
38 end
lazy_map(*) click to toggle source
   # File lib/tilt.rb
25 def lazy_map(*)
26   raise "Tilt.#{__callee__} not supported after Tilt.finalize! has been called"
27 end
new(file, line=nil, options=nil, &block) click to toggle source

@see Tilt::Mapping#new

   # File lib/tilt.rb
66 def self.new(file, line=nil, options=nil, &block)
67   @default_mapping.new(file, line, options, &block)
68 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
61 def self.registered?(ext)
62   @default_mapping.registered?(ext)
63 end
template_for(file) click to toggle source

@see Tilt::Mapping#template_for

   # File lib/tilt.rb
76 def self.template_for(file)
77   @default_mapping.template_for(file)
78 end
templates_for(file) click to toggle source

@see Tilt::Mapping#templates_for

   # File lib/tilt.rb
81 def self.templates_for(file)
82   @default_mapping.templates_for(file)
83 end