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
orlocals
. 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
@return [Tilt::Mapping] the main mapping object
Whether to extract fixed locals from templates by scanning the template content.
Public Class Methods
Source
# File lib/tilt.rb 75 def self.[](file) 76 @default_mapping[file] 77 end
@see Tilt::Mapping#[]
Source
# 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
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.
Source
# File lib/tilt.rb 29 def lazy_map(*) 30 raise "Tilt.#{__callee__} not supported after Tilt.finalize! has been called" 31 end
Source
# File lib/tilt.rb 70 def self.new(file, line=nil, options=nil, &block) 71 @default_mapping.new(file, line, options, &block) 72 end
@see Tilt::Mapping#new
Source
# File lib/tilt.rb 65 def self.registered?(ext) 66 @default_mapping.registered?(ext) 67 end
Source
# File lib/tilt.rb 80 def self.template_for(file) 81 @default_mapping.template_for(file) 82 end
Source
# File lib/tilt.rb 85 def self.templates_for(file) 86 @default_mapping.templates_for(file) 87 end