module Aladdin

Constants

PATHS

Paths to other parts of the library.

VERSION
VIEWS

Paths to different types of views.

Attributes

config[RW]

@!attribute [r] config

@return [Hash] configuration hash

Public Instance Methods

launch(opts = {}) click to toggle source

Launches the previewer app. @return [void]

# File lib/aladdin.rb, line 26
def launch(opts = {})
  prepare opts
  Aladdin::App.run!
rescue => e
  puts e.message
end
prepare(opts = {}) click to toggle source

Prepares to launch the previewer app by configuring sinatra. @option opts [String] from (Dir.pwd) path to author’s markdown documents @return [void]

# File lib/aladdin.rb, line 16
def prepare(opts = {})
  root = opts[:from] || Dir.pwd
  @config = Config.new root
  require 'aladdin/app'
  Aladdin::App.set :root, root
  Aladdin::App.set :views, Aladdin::VIEWS.merge(markdown: root)
end