module Tilt
Namespace for Tilt. This module is not intended to be included anywhere.
Constants
- AsciidoctorTemplate
- BabelTemplate
- CommonMarkerTemplate
- EMPTY_ARRAY
- EMPTY_HASH
- HamlTemplate
Haml >= 6 ships its own template, prefer it when available.
- KramdownTemplate
- LOCK
@private
- LiveScriptTemplate
- PandocTemplate
- PlainTemplate
- RDiscountTemplate
- RDocTemplate
- RedClothTemplate
- RedcarpetTemplate
- RstPandocTemplate
- 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
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