public
Description: Rails plugin for integrating help content from ScreenSteps Live into your Rails app.
Homepage: http://screensteps.com/blog
Clone URL: git://github.com/bluemango/screensteps_help.git
Greg DeVore (author)
Fri Jul 11 01:30:15 -0700 2008
commit  e73110cc1ac7e877925bc034578e4304f163773b
tree    6fb77dd751d2933fef95b8a17778a27f2c3cdc20
parent  fa9da06c9c7fa8fa2934524e58ff6425f67d80aa
name age message
file MIT-LICENSE Loading commit data...
file README
file Rakefile
file init.rb
file install.rb
directory lib/
directory tasks/
directory test/
file uninstall.rb
README
ScreenStepsHelp
===============

The ScreenStepsHelp plugin allows you to easily add content from ScreenSteps Live (www.screenstepslive.com) to your own 
Rails application.  The idea is that you can manage all of your help content on ScreenSteps Live but have it show up in 
your Rails application. 


Setup
=======

You need to add the following to your environment.rb file:

ENV['SCREENSTEPS_LIVE_API_KEY'] = "YOUR API KEY FROM SCREENSTEPS LIVE"
ENV['SCREENSTEPS_LIVE_DOMAIN'] = "YOUR_ACCOUNT.screenstepslive.com"

If you would like to just try some examples out you can use the following settings to grab content from an example 
ScreenSteps Live account:

ENV['SCREENSTEPS_LIVE_API_KEY'] = "12e5317e88"
ENV['SCREENSTEPS_LIVE_DOMAIN'] = "example.screenstepslive.com"

You will also need to add this to your application controller:

include ScreenstepsHelp


Example
=======

## CONTROLLER
You might have a help controller in your application.  Here are some example actions:

def index
  # returns a hash of all manuals for an account
  @manuals = get_manuals(:show_protected => true)
end

def show
  # returns a hash of the contents of a manual
  @manual = get_manual(params[:id], :show_protected => true)
end

def show_lesson
  # returns a hash of a lesson that is part of a manual
  @lesson = get_lesson(params[:manual_id], params[:id], :show_protected => true)
end

The :show_protected parameter determines whether ScreenSteps Live will return manuals that you have marked as protected. 
 If you don't pass the parameter then only public manuals will be returned.

## Views

To insert the manuals and lessons into your views you can iterate over the hashes yourself or use the built in view 
helpers.  Here are some examples:

LIST ALL MANUALS
# returns a ul of all manuals with links to the path specified by :path or the url for the manual on ScreenSteps Live if 
no :path hash is sent.

<%= manuals_list(@manuals, :path => {:action => "show"}, 
            :id => "manuals",
            :list_options => {:class => "manual"},
            :link_options => {:class => "link"}) %>
            
LIST CONTENTS OF A MANUAL
# returns a ul of the sections and lessons in a manual.  Path is handled as described above.

<%= show_manual @manual, :title => {:tag => "h2", :class => "title"}, 
             :sections_list => {:id => "manual", :class => "manual"},
             :sections => {:class => "section", :tag => "span"},
             :list_options => {:class => "lesson"},
             :link_options  => {:class => "link"},
             :path => {:action => "show_lesson"} %>
            
DISPLAY A LESSON IN A MANUAL

<%= show_lesson(@lesson, :title => {:tag => "h1", :class => "title"},
             :step_titles  =>  {:tag => "h3", :class => "title"}
              ) %>

LINK TO PREVIOUS LESSON IN A MANUAL
<%= previous_lesson(@lesson, {:action => "show_lesson"}) %>

LINK TO NEXT LESSON IN A MANUAL          
<%= next_lesson(@lesson, {:action => "show_lesson"}) %>

These will add <span>Next Lesson: </span> before the link.



Copyright (c) 2008 Blue Mango Learning Systems, LLC, released under the MIT license