Sha256: f52aebe99d19bd263efdfc64c58d6b873533dfe59d17609a3c0e808435423da6
Contents?: true
Size: 1.08 KB
Versions: 1
Compression:
Stored size: 1.08 KB
Contents
#!/usr/bin/env ruby here = File.expand_path(File.dirname(__FILE__)) $: << File.join(here, '..', 'lib') require "rack" require "deck" require "deck/rack_app" command = ARGV.shift case command when 'build' slides = [] output_path = nil output_dir = "." # for now, since deck.js is relative to the project root ARGV.each do |arg| # output_dir ||= File.dirname(arg) basename ||= File.basename(arg, ".md") output_path ||= "#{output_dir}/#{basename}.html" slides += Slide.from_file arg end File.open(output_path, "w") do |file| deck = SlideDeck.new :slides => slides # deck.to_pretty(:output => file) # todo: figure out why this doesn't work file.write deck.to_pretty end when 'run' # Fix Rack bug https://github.com/rack/rack/issues/301 require 'deck/rack_static_patch' port = 4333 # todo: option slide_files = ARGV Rack::Handler.default.run Deck::RackApp.build(slide_files), :Port => port else puts "Unknown command '#{command}'" puts <<-USAGE Usage: deck build src.md... deck run src.md... USAGE exit 1 end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
deckrb-0.1.1 | bin/deck |