Sha256: f783db46e98ff605a228131a2ef6790d77ea5a69dd7fa36b43828d8745fb3f34

Contents?: true

Size: 1.55 KB

Versions: 1

Compression:

Stored size: 1.55 KB

Contents

#!/usr/bin/env ruby
require 'gli'
require 'reveal-ck'

include GLI::App

program_desc 'A reveal.js construction kit'

version RevealCK::VERSION

desc 'Generate reveal.js slides'
command :generate do |c|
  c.action do |global_options,options,args|

    require 'rake' # for FileList

    revealjs_root = File.expand_path(File.join(File.dirname(__FILE__), '..', 'reveal.js'))
    revealjs_files = FileList["#{revealjs_root}/**/*"]

    image_files = FileList["images/**/*"]

    output_dir = 'slides'

    slides_haml = 'slides.haml'

    config = RevealCK::Config.new config_file: 'config.toml'

    builder = RevealCK::PresentationBuilder.new({
                                                  revealjs_files: revealjs_files,
                                                  image_files: image_files,
                                                  output_dir: output_dir,
                                                  slides_haml: slides_haml,
                                                  config: config
                                                })
    builder.build!

  end
end

pre do |global,command,options,args|
  # Pre logic here
  # Return true to proceed; false to abort and not call the
  # chosen command
  # Use skips_pre before a command to skip this block
  # on that command only
  true
end

post do |global,command,options,args|
  # Post logic here
  # Use skips_post before a command to skip this
  # block on that command only
end

on_error do |exception|
  # Error logic here
  # return false to skip default error handling
  true
end

exit run(ARGV)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
reveal-ck-0.1.3 bin/reveal-ck