Sha256: 5ff26ab699f406a3600ff1363e2be3c4c7a38c0e229758fec7dfea397633a893

Contents?: true

Size: 1.15 KB

Versions: 18

Compression:

Stored size: 1.15 KB

Contents

require 'awestruct/handler_chain'
require 'awestruct/handlers/base_handler'
require 'awestruct/handlers/file_handler'
require 'awestruct/handlers/front_matter_handler'
require 'awestruct/handlers/interpolation_handler'
require 'awestruct/handlers/layout_handler'
require 'org-ruby'

module Awestruct
  module Handlers
    class OrgmodeHandler < BaseHandler

      CHAIN = Awestruct::HandlerChain.new( /\.org$/,
        Awestruct::Handlers::FileHandler,
        Awestruct::Handlers::FrontMatterHandler,
        Awestruct::Handlers::InterpolationHandler,
        Awestruct::Handlers::OrgmodeHandler,
        Awestruct::Handlers::LayoutHandler
      )

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

      def simple_name
        File.basename( relative_source_path, '.org' ) 
      end

      def output_filename
        File.basename( relative_source_path, '.org' ) + '.html'
      end

      def output_extension
        '.html'
      end

      def content_syntax
        :orgmode
      end

      def rendered_content(context, with_layouts=true)
        Orgmode::Parser.new(super( context, with_layouts) ).to_html
      end

    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
awestruct-0.4.8 lib/awestruct/handlers/orgmode_handler.rb
awestruct-0.4.7 lib/awestruct/handlers/orgmode_handler.rb
awestruct-0.4.6 lib/awestruct/handlers/orgmode_handler.rb
awestruct-0.4.5 lib/awestruct/handlers/orgmode_handler.rb
awestruct-0.4.4 lib/awestruct/handlers/orgmode_handler.rb
awestruct-0.4.3 lib/awestruct/handlers/orgmode_handler.rb
awestruct-0.4.2 lib/awestruct/handlers/orgmode_handler.rb
awestruct-0.4.2.x10 lib/awestruct/handlers/orgmode_handler.rb
awestruct-0.4.2.x9 lib/awestruct/handlers/orgmode_handler.rb
awestruct-0.4.2.x8 lib/awestruct/handlers/orgmode_handler.rb
awestruct-0.4.2.x7 lib/awestruct/handlers/orgmode_handler.rb
awestruct-0.4.2.x6 lib/awestruct/handlers/orgmode_handler.rb
awestruct-0.4.2.x5 lib/awestruct/handlers/orgmode_handler.rb
awestruct-0.4.2.x4 lib/awestruct/handlers/orgmode_handler.rb
awestruct-0.4.2.x3 lib/awestruct/handlers/orgmode_handler.rb
awestruct-0.4.2.x2 lib/awestruct/handlers/orgmode_handler.rb
awestruct-0.4.2.x1 lib/awestruct/handlers/orgmode_handler.rb
awestructx-0.4.1.x1 lib/awestruct/handlers/orgmode_handler.rb