= bookingit A basic publishing system that takes Mardown and a Git repository and produces a readable "book" in the following forms: * Website * PDF * EBook The idea is to easily show the evolution of code over the course of the book, based entirely on git diffs and pull requests. == Example Here is how our controller looks currently: git:///path/to/repo.git/app/controlleres/users_controller.rb#initial-version We'd like to change the mailer call to use Resque git:///path/to/repo.git/app/controllers/users_controller.rb#initial-version..add-resque-to-controller This bit of Markdown would be interpretted as if the contents were placed inline like so: Here is how our controller looks currently: ```ruby class UsersController < ApplicationController::Base def create @user = User.new(params.require(:user)) if @user.save UserMailer.welcome_email(user).deliver redirect_to root_path else render 'new' end end end ``` We'd like to change the mailer call to use Resque ```diff --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb def create @user = User.new(params.require(:user)) if @user.save - UserMailer.welcome_email(user).deliver + Resque.enqueue(WelcomeEmailJob,user.id) redirect_to root_path else ``` We can also insert the output of commands: Now, let's run our tests sh:///path/to/wherever#rake test This would be as if the output were inline like so: Now, let's run our tests. ```bash > rake test ........................... Finished in 0.00946 seconds 27 examples, 0 failures Randomized with seed 43200 ``` == TODO Given the above, a minimal solution would be: * Given some markdown files * And a configuration file * Be able to generate a multi-page HTML5 website with a table of contents === Configuration At the bare minimum the configuration file needs to indicate a structure that maps sections to markdown files. Something like this: { front_matter: [ "acknowledgements.md", "intro.md" ], main_matter: [ "getting_started.md", ["our_first_controller.md","our_first_model.md","running_tests.md"], "chapter3*.md", ], back_matter: [ "glossary.md" ] } We have front, main, and back matter. Inside each we can provide a list of files the be used in order, that represent "chapters" in that section. A chapter can be specified either as a single file, a list of files that are subsections, or a glob. No markup is added, this just specifies the order of processing and how to make the TOC.