module Parade::Parsers::PresentationDirectoryParser

Constants

SLIDE_SEARCH_PATTERN

Public Class Methods

parse(filepath,options = {}) click to toggle source
# File lib/parade/parsers/presentation_directory_parser.rb, line 11
def self.parse(filepath,options = {})

  parade_file = Array(options[:parade_file]).find do |relative_filepath|
    parade_file = File.join(filepath,relative_filepath)
    File.exists? parade_file
  end
  
  if parade_file
    PresentationFileParser.parse File.join(filepath,parade_file), options
  else

    slides = Dir[File.join(filepath,SLIDE_SEARCH_PATTERN)].map do |slide_filepath|
      SlidesFileContentParser.parse slide_filepath, options
    end

    section = Section.new
    section.add_section slides
    section

  end
end