0.0
No commit activity in last 3 years
No release in over 3 years
Ghost Story allows you to write a story in markdown. The story can then be read back to you. A ghost story is both text and automated scripts that will type out code.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.5
>= 0

Runtime

>= 0.0.1
~> 1.1
~> 0.18
 Project Readme

GhostStory

Ghost Story allows you to write a story in markdown. The story can then be read back to you. A ghost story is both text and automated scripts that will type out code.

The initial use case is for composing repeatable screencasts. When you set out to write a screencast you often times compose a script and the code that accompanies it. There are some inherent problems with this manual method of telling a story:

  • Typing the code is cumbersome and error prone
  • Removing errors and mistyping during the editing process is a waste of time
  • Editing or updating your screencast later requires you re-create an entire section manually.

Installation

Add this line to your application's Gemfile:

gem 'ghost_story'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ghost_story

Usage

First write the script that you want to execute in markdown.

# Ruby Classes

If you are already familar with classes in other languages, you will have
no time understanding how they are created in Ruby.

~~~~
class Square

  def initialize(height)
    @height = height
  end

  attr_reader :height

  def area
    height * height
  end
end
~~~~

Then with the completed script you run the ghost_story binary which will read the story and then create an interactive version which will show you the written parts and then type the code between the code fences.

Some limitation in Kramdown, which is used to generate an object representation of the document, works consistently with the ~~~ instead of the three backticks.

$ ghost_story tell ruby_classes.md APPLICATION

The application you specify is important. That is the name of the Appliation that the key events will be sent. At the moment, this is fairly simplistic and will really only work with non-Terminal editors.

Also, note that if your editor helps you with auto indention when you are writing code, this will need to be turned off. I found that with Sublime Text I needed to set "auto_indent": false for example.

Contributing

  1. Fork it ( http://github.com//ghost_story/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request