Sha256: 6b8d61ffacc070ef4b76ee3745ac6e0cba2eb3038133c43c1b5dd6601bd97d27

Contents?: true

Size: 1003 Bytes

Versions: 1

Compression:

Stored size: 1003 Bytes

Contents

require 'thor'
require 'marksman'

module Marksman
  class CLI < Thor

    desc 'generate FILE [OUTPUT DIRECTORY]', 'generates a presentation from a markdown file'
    long_desc <<-LONGDESC
      `marsksman generate file.md` will parse the markdown file and 
      create a presentation in the folder 'public'

      You can optionally specify the folder where the presentation is stored
      as a second parameter.

      > $ marksman FILE.md output
    LONGDESC
    method_option :theme, desc: 'override the theme in the presentation', aliases: ['-t']
    def generate(file, target = 'public')
      Marksman::Writer.new(file, target, options[:theme]).generate
    end

    desc 'watch FILE [OUTPUT DIRECTORY]', 'same as generate, but watches the file and regenerates it on each change'
    method_option :theme, desc: 'override the theme in the presentation', aliases: ['-t']
    def watch(file, target = 'public')
      Marksman::Watcher.new(file, target, options[:theme]).watch
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
marksman-0.1 lib/marksman/cli.rb