== Welcome to bookshop
bookShop is a publishing framework for html-to-(e)book toolchain happiness and sustainable productivity. The framework is optimized to help developers quickly ramp-up, allowing them to more rapidly jump in and develop their html-to-(e)book (print-pdf, epub, mobi, etc.) flows, by favoring convention over configuration, setting them up with best practices, standards and tools from the start.
bookshop hopes to simplify the process by:
* using common developer tools like HTML, CSS, etc. to make the creation of your book comfortable and familiar, greatly reducing the learning curve for your developers, authors, agents, and other team members
* providing a Ruby Gem to make building a book from HTML as easy as 'sudo gem install bookshop'
* pulling all the html-to-(e)book tools together into one place (wkhtmltopdf, kindlegen, epubcheck)
* sticking with open-source tools
* giving the developer a set of scripts to automate the redundant stuff
* providing an architecture/structure that follows best-practices and simplification (DRY... Don't Repeat Yourself)
* providing an extendable framework for other developers to add their own custom templates (and hopefully provide them for the community)
== Getting Started
=== System Requirements
* Ruby v1.8.7 or v1.9.2 http://www.ruby-lang.org/en/downloads/
* Rubygems v1.3.6 http://docs.rubygems.org/read/chapter/3
* Java v1.6 http://www.java.com/
== Installation
=== Install bookshop
$ gem install bookshop
=== Install wkhtmltopdf
1. Install by hand (recommended):
https://github.com/blueheadpublishing/bookshop/wiki/Installing-wkhtmltopdf
2. Try using the wkhtmltopdf-binary gem (mac + linux i386)
$ gem install wkhtmltopdf-binary
3. The wkhtmltopdf site has more info
http://code.google.com/p/wkhtmltopdf/
== Using bookshop
=== Create a bookshop application
$ bookshop new name_of_book
This will create a new bookshop app in /path/to/name_of_book
* If you can't issue bookshop from your command line, make sure you have included your gems folder in your system $PATH. In unix you can add the following to your .bashrc file in your home folder (this example is for Ubuntu 10.10):
PATH="$PATH:/var/lib/gems/1.8/bin"
export PATH
=== Editing Your New Book
All of the source documents/code/assets (yay... HTML/CSS) for your book are stored in the +book/+ folder. The master file, from which everything is built is +book/book.html.erb+. Since this is an ERB file, you can do all kinds of things like:
* embed ruby functions and calls
Today is <%= Time.now.strftime('%A') %>.
or
<% for @item in @shopping_list %>
- <%= @item %>
<% end %>
* include other files or template structures
* explore other creative ways to structure and enhance your book (we'd love to see how you are doing it)
When the book is built, your master +book/book.html.erb+ file will be compiled into the final HTML which will be used to build the book types.
When you are finished editing your source you can build whichever type of your book that you would like. Currently the only supported builds are pdf and html (and soon epub and mobi).
=== Building Your First Book
To build a pdf format of your book from the html source:
$ bookshop build pdf
== Getting Help
* bookshop comes with a built in help feature. Simply run 'bookshop --help' from the command line to get list of possible commands to issue including possible options. You can also run 'bookshop COMMAND --help' (where COMMAND is the command you want) to get a list of possible options for that particular command
== Description of bookshop app contents
The default directory structure of a generated bookshop project:
|-- book
|-- builds
epub
html
mobi
pdf
|-- config
|-- tools
book
Holds all the manuscript html code/files. This is where your master manuscript lives from which everything is built.
builds
Holds all the output files built from the html
builds/epub
When building the epub, the generated output will reside here in an .epub file. You can rename the .epub extension to .zip then unzip the file to view the contents.
build/mobi
When building the mobi asset, the generated output will reside here as "book.mobi"
build/pdf
When building the pdf book, the generated output will reside here as "book.pdf"
config
application-wide variables and configurations will go here
tools
Holds all third-party tools: epubcheck, kindlegen
== Get Involved
1. Fork the repository.
2. Pick an issue (or feature you want to add).
3. Make changes to your forked code.
4. Add tests so that we don't accidentally break your addition with our future commits.
5. Commit to your git (forked) repository.
6. Let us know about your code and we'll review/merge it into the master.
7. And pat yourself on the back for contributing to an open source project!!
== Copyright (MIT-LICENSE)
Copyright (C) 2010, 2011 by BlueHead Publishing, Inc (http://blueheadpublishing.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
== The Boom Microformat License (as listed in the boom.css)
Sample style sheet for boom!, the book microformat
written by Hakon Wium Lie and Bert Bos, November 2005
You may reuse this style sheet for any purpose without any fees
== Thanks
We would like to thank:
* The Ruby/Rubygems Team www.ruby-lang.org/
* The Thor Team - https://github.com/wycats/thor
* Hakon Wium Lie and Bert Bos for developing the book microformat http://www.alistapart.com/articles/boom
* The WKHTMLTOPDF team http://code.google.com/p/wkhtmltopdf/
* The EPUBCHECK team http://code.google.com/p/epubcheck/