Class: Awestruct::Handlers::TiltHandler

Inherits:
BaseTiltHandler show all
Defined in:
lib/awestruct/handlers/tilt_handler.rb

Direct Known Subclasses

AsciidoctorHandler

Constant Summary collapse

INTERPOLATION_CHAIN =
Awestruct::HandlerChain.new( Awestruct::Handlers::TiltMatcher.new(),
  Awestruct::Handlers::FileHandler,
  Awestruct::Handlers::FrontMatterHandler,
  Awestruct::Handlers::InterpolationHandler,
  Awestruct::Handlers::TiltHandler,
  Awestruct::Handlers::LayoutHandler
)
NON_INTERPOLATION_CHAIN =
Awestruct::HandlerChain.new( Awestruct::Handlers::NonInterpolatingTiltMatcher.new(),
  Awestruct::Handlers::FileHandler,
  Awestruct::Handlers::FrontMatterHandler,
  Awestruct::Handlers::TiltHandler,
  Awestruct::Handlers::LayoutHandler
)

Instance Attribute Summary

Attributes inherited from BaseHandler

#delegate, #site

Instance Method Summary collapse

Methods inherited from BaseTiltHandler

#content_syntax, #double_extension?, #input_extension, #options, #output_extension, #output_filename, #rendered_content, #simple_name, #source_file_name

Methods inherited from BaseHandler

#content_line_offset, #content_syntax, #dependencies, #execute_shell, #front_matter, #inherit_front_matter, #input_mtime, #output_extension, #output_filename, #output_path, #path, #raw_content, #relative_source_path, #rendered_content, #simple_name, #stale?, #to_chain

Constructor Details

#initialize(site, delegate) ⇒ TiltHandler

Returns a new instance of TiltHandler.



49
50
51
52
53
54
55
56
57
58
# File 'lib/awestruct/handlers/tilt_handler.rb', line 49

def initialize(site, delegate)
  super( site, delegate )

  # JP: Not sure if this is the best place, but I can't find a better place
  # We want to use our template for now as we have some special integrations
  if (defined? ::Asciidoctor::Document && ::Tilt.default_mapping['adoc'] == ::Awestruct::Tilt::AsciidoctorTemplate)
    require 'awestruct/handlers/template/asciidoc'
    ::Tilt.register ::Awestruct::Tilt::AsciidoctorTemplate, 'adoc', 'asciidoc', 'ad'
  end
end