bookshop 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,62 +1,66 @@
1
+ 0.0.15:
2
+ Features
3
+ Added ERB functionality to the book source
4
+
1
5
  0.0.14:
2
- Moved repository to blueheadpublishing and modified gem source
3
- to update all links
6
+ Moved repository to blueheadpublishing and modified gem source
7
+ to update all links
4
8
 
5
- Features
6
- Added CHANGELOG into project template to provide users with a
7
- best-practices in documenting version changes.
9
+ Features
10
+ Added CHANGELOG into project template to provide users with a
11
+ best-practices in documenting version changes
8
12
 
9
13
  0.0.13:
10
- Bug fixes
11
- Fixed build pdf command so it doesn't try to build epub
14
+ Bug fixes
15
+ Fixed build pdf command so it doesn't try to build epub
12
16
 
13
17
  0.0.12:
14
- Doc fixes
15
- Added new post-install message to alert users to install wkhtmltopdf
16
-
17
- Removed old POST_INSTALL file
18
+ Doc fixes
19
+ Added new post-install message to alert users to install wkhtmltopdf
20
+
21
+ Removed old POST_INSTALL file
18
22
 
19
23
  0.0.11:
20
- Complete rewrite
21
- Switched from docbook toolchain to html/css/javascript toolchain
22
-
23
- Removed all XML/XSLT/FOP dependencies since no longer using docbook
24
-
25
- Added wkhtmltopdf as the html-to-pdf processor
26
-
27
- Added Boom(.css) microformat to replace structural markup previously
28
- available via docbook
29
-
30
- Moved copyright to BlueHead Inc
24
+ Complete rewrite
25
+ Switched from docbook toolchain to html/css/javascript toolchain
26
+
27
+ Removed all XML/XSLT/FOP dependencies since no longer using docbook
28
+
29
+ Added wkhtmltopdf as the html-to-pdf processor
30
+
31
+ Added Boom(.css) microformat to replace structural markup previously
32
+ available via docbook
33
+
34
+ Moved copyright to BlueHead Inc
31
35
 
32
36
  0.0.4:
33
- Core Changes
34
- Added new mobi build
35
-
36
- Branding around World Uniting Press
37
-
38
- Added epubcheck for epub validations, v1.2
39
-
40
- Added kindlegen for generating mobi
37
+ Core Changes
38
+ Added new mobi build
39
+
40
+ Branding around World Uniting Press
41
+
42
+ Added epubcheck for epub validations, v1.2
43
+
44
+ Added kindlegen for generating mobi
41
45
 
42
46
 
43
47
  0.0.3:
44
- Core Changes
45
- Added Java toolsets, including all necessary .jars for working with Docbook and
46
- bookshop
47
-
48
- Updated documentation to include information on how to setup java tools and Classpaths on various systems
49
-
50
- Added MIT-LICENSE
51
-
52
- Application Generator now has dynamically generated dates and content
53
-
54
- Added epub build command
55
-
56
- Added pdf build command
57
-
58
- Significant rework of Command Line Interface and 'help' dialogues
59
-
60
-
61
- Bug Fixes
62
- (none as this was a substantial rework)
48
+ Core Changes
49
+ Added Java toolsets, including all necessary .jars for working with
50
+ Docbook and bookshop
51
+
52
+ Updated documentation to include information on how to setup java tools
53
+ and Classpaths on various systems
54
+
55
+ Added MIT-LICENSE
56
+
57
+ Application Generator now has dynamically generated dates and content
58
+
59
+ Added epub build command
60
+
61
+ Added pdf build command
62
+
63
+ Significant rework of Command Line Interface and 'help' dialogues
64
+
65
+ Bug Fixes
66
+ (none as this was a substantial rework)
data/README.rdoc CHANGED
@@ -3,6 +3,7 @@
3
3
  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.
4
4
 
5
5
  bookshop hopes to simplify the process by:
6
+ * 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
6
7
  * providing a Ruby Gem to make building a book from HTML as easy as 'sudo gem install bookshop'
7
8
  * pulling all the html-to-(e)book tools together into one place (wkhtmltopdf, kindlegen, epubcheck)
8
9
  * sticking with open-source tools
@@ -51,38 +52,38 @@ bookshop hopes to simplify the process by:
51
52
  PATH="$PATH:/var/lib/gems/1.8/bin"
52
53
  export PATH
53
54
 
54
- === Building Your First Book
55
+ === Editing Your New Book
55
56
 
56
- To build a pdf format of your book from the html source:
57
+ 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:
57
58
 
58
- $ bookshop build pdf
59
+ * embed ruby functions and calls
59
60
 
60
- == Getting Help
61
+ <p>Today is <%= Time.now.strftime('%A') %>.</p>
61
62
 
62
- * 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
63
+ or
63
64
 
64
- == Thanks
65
+ <ul>
66
+ <% for @item in @shopping_list %>
67
+ <li><%= @item %></li>
68
+ <% end %>
69
+ </ul>
70
+
71
+ * include other files or template structures
72
+ * explore other creative ways to structure and enhance your book (we'd love to see how you are doing it)
65
73
 
66
- We would like to thank:
74
+ 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.
67
75
 
68
- * The Ruby/Rubygems Team www.ruby-lang.org/
69
- * The Thor Team - https://github.com/wycats/thor
70
- * Hakon Wium Lie and Bert Bos for developing the book microformat http://www.alistapart.com/articles/boom
71
- * The WKHTMLTOPDF team http://code.google.com/p/wkhtmltopdf/
72
- * The EPUBCHECK team http://code.google.com/p/epubcheck/
76
+ 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).
73
77
 
74
- == Description of Gem Contents
78
+ === Building Your First Book
75
79
 
76
- The basic bookshop gem architecture:
80
+ To build a pdf format of your book from the html source:
77
81
 
78
- |-- bin
79
- |-- lib
82
+ $ bookshop build pdf
80
83
 
81
- bin
82
- command file copied to /usr/bin upon installation (which is then called from the command line)
84
+ == Getting Help
83
85
 
84
- lib
85
- bookshop gem library files
86
+ * 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
86
87
 
87
88
  == Description of bookshop app contents
88
89
 
@@ -154,4 +155,14 @@ THE SOFTWARE.
154
155
 
155
156
  Sample style sheet for boom!, the book microformat
156
157
  written by Hakon Wium Lie and Bert Bos, November 2005
157
- You may reuse this style sheet for any purpose without any fees
158
+ You may reuse this style sheet for any purpose without any fees
159
+
160
+ == Thanks
161
+
162
+ We would like to thank:
163
+
164
+ * The Ruby/Rubygems Team www.ruby-lang.org/
165
+ * The Thor Team - https://github.com/wycats/thor
166
+ * Hakon Wium Lie and Bert Bos for developing the book microformat http://www.alistapart.com/articles/boom
167
+ * The WKHTMLTOPDF team http://code.google.com/p/wkhtmltopdf/
168
+ * The EPUBCHECK team http://code.google.com/p/epubcheck/
@@ -1,4 +1,6 @@
1
1
  require 'thor/group'
2
+ require 'erb'
3
+ require 'fileutils'
2
4
 
3
5
  module Bookshop
4
6
  module Commands
@@ -14,9 +16,11 @@ module Bookshop
14
16
 
15
17
  build = ARGV.shift
16
18
  build = aliases[build] || build
19
+
20
+ erb = ERB.new(File.read('book/book.html.erb'))
17
21
 
18
22
  # Define arguments and options
19
- argument :type, :type => :string
23
+ argument :type
20
24
 
21
25
  # Define source root of application
22
26
  def self.source_root
@@ -24,13 +28,41 @@ module Bookshop
24
28
  end
25
29
 
26
30
  case build
31
+
32
+ # 'build html' creates a html version of the book
33
+ when 'html'
34
+ # Clean up any old builds
35
+ puts "Deleting any old builds"
36
+ FileUtils.rm_r Dir.glob('builds/html/*')
37
+
38
+ puts "Generating new html from erb"
39
+ File.open('builds/html/book.html', 'a') do |f|
40
+ f << erb.result
41
+ end
42
+
43
+ FileUtils.cp_r('book/css/', 'builds/html/', :verbose => true)
44
+ FileUtils.cp_r('book/images/', 'builds/html/', :verbose => true)
45
+
46
+ # 'build pdf' creates a pdf version of the book
27
47
  when 'pdf'
48
+ # Clean up any old builds
28
49
  puts "Deleting any old builds"
29
- File.delete("builds/pdf/book.pdf") if File::exists?( "builds/pdf/book.pdf" )
30
- puts "File Deleted"
31
- puts "Building new pdf at builds/pdf/book.pdf"
32
- cmd = %x[wkhtmltopdf book/book.html builds/pdf/book.pdf]
33
- # cmd = %x[wkhtmltopdf #{SRC_FILE} #{OUT_FILE}]
50
+ FileUtils.rm_r Dir.glob('builds/pdf/*')
51
+ FileUtils.rm_r Dir.glob('builds/html/*')
52
+
53
+ # Generate the html from ERB
54
+ puts "Generating new html from erb"
55
+ File.open('builds/html/book.html', 'a') do |f|
56
+ f << erb.result
57
+ end
58
+
59
+ # Copy over html assets
60
+ FileUtils.cp_r('book/css/', 'builds/html/', :verbose => true)
61
+ FileUtils.cp_r('book/images/', 'builds/html/', :verbose => true)
62
+
63
+ # Build the pdf
64
+ puts "Building new pdf at builds/pdf/book.pdf from new html build"
65
+ cmd = %x[wkhtmltopdf builds/html/book.html builds/pdf/book.pdf]
34
66
 
35
67
  else
36
68
  puts "Error: Command not recognized" unless %w(-h --help).include?(build)
@@ -39,9 +71,7 @@ module Bookshop
39
71
 
40
72
  The most common build commands are:
41
73
  pdf Builds a new pdf at /builds/pdf/book.pdf
42
- epub Builds a new epub at /builds/epub/book.epub
43
74
  html Builds a new html at /builds/html/book.html
44
- all Builds all possible builds in their respective locations
45
75
 
46
76
  All commands can be run with -h for more information.
47
77
  EOT
@@ -8,9 +8,12 @@ command = ARGV.shift
8
8
  command = aliases[command] || command
9
9
 
10
10
  case command
11
+
12
+ # command for calling a build of a book (e.g. pdf, epub)
11
13
  when 'build'
12
14
  require 'bookshop/commands/build'
13
15
 
16
+ # command for generating a new book project
14
17
  when 'new'
15
18
  puts "Can't create a new Bookshop application within the directory of another, please change to a non-Bookshop directory first.\n"
16
19
  puts "Type 'bookshop' for help."
@@ -3,6 +3,7 @@
3
3
  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.
4
4
 
5
5
  bookshop hopes to simplify the process by:
6
+ * 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
6
7
  * providing a Ruby Gem to make building a book from HTML as easy as 'sudo gem install bookshop'
7
8
  * pulling all the html-to-(e)book tools together into one place (wkhtmltopdf, kindlegen, epubcheck)
8
9
  * sticking with open-source tools
@@ -51,38 +52,38 @@ bookshop hopes to simplify the process by:
51
52
  PATH="$PATH:/var/lib/gems/1.8/bin"
52
53
  export PATH
53
54
 
54
- === Building Your First Book
55
+ === Editing Your New Book
55
56
 
56
- To build a pdf format of your book from the html source:
57
+ 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:
57
58
 
58
- $ bookshop build pdf
59
+ * embed ruby functions and calls
59
60
 
60
- == Getting Help
61
+ <p>Today is <%= Time.now.strftime('%A') %>.</p>
61
62
 
62
- * 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
63
+ or
63
64
 
64
- == Thanks
65
+ <ul>
66
+ <% for @item in @shopping_list %>
67
+ <li><%= @item %></li>
68
+ <% end %>
69
+ </ul>
70
+
71
+ * include other files or template structures
72
+ * explore other creative ways to structure and enhance your book (we'd love to see how you are doing it)
65
73
 
66
- We would like to thank:
74
+ 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.
67
75
 
68
- * The Ruby/Rubygems Team www.ruby-lang.org/
69
- * The Thor Team - https://github.com/wycats/thor
70
- * Hakon Wium Lie and Bert Bos for developing the book microformat http://www.alistapart.com/articles/boom
71
- * The WKHTMLTOPDF team http://code.google.com/p/wkhtmltopdf/
72
- * The EPUBCHECK team http://code.google.com/p/epubcheck/
76
+ 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).
73
77
 
74
- == Description of Gem Contents
78
+ === Building Your First Book
75
79
 
76
- The basic bookshop gem architecture:
80
+ To build a pdf format of your book from the html source:
77
81
 
78
- |-- bin
79
- |-- lib
82
+ $ bookshop build pdf
80
83
 
81
- bin
82
- command file copied to /usr/bin upon installation (which is then called from the command line)
84
+ == Getting Help
83
85
 
84
- lib
85
- bookshop gem library files
86
+ * 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
86
87
 
87
88
  == Description of bookshop app contents
88
89
 
@@ -154,4 +155,14 @@ THE SOFTWARE.
154
155
 
155
156
  Sample style sheet for boom!, the book microformat
156
157
  written by Hakon Wium Lie and Bert Bos, November 2005
157
- You may reuse this style sheet for any purpose without any fees
158
+ You may reuse this style sheet for any purpose without any fees
159
+
160
+ == Thanks
161
+
162
+ We would like to thank:
163
+
164
+ * The Ruby/Rubygems Team www.ruby-lang.org/
165
+ * The Thor Team - https://github.com/wycats/thor
166
+ * Hakon Wium Lie and Bert Bos for developing the book microformat http://www.alistapart.com/articles/boom
167
+ * The WKHTMLTOPDF team http://code.google.com/p/wkhtmltopdf/
168
+ * The EPUBCHECK team http://code.google.com/p/epubcheck/
@@ -4,7 +4,7 @@
4
4
  <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
5
5
  <title>Cascading Style Sheets - Designing for the Web</title>
6
6
  <meta name="author" content="H�kon Wium Lie">
7
- <link rel="stylesheet" type="text/css" href="css/boom.css">
7
+ <link rel="stylesheet" type="text/css" href="css/stylesheet.css">
8
8
  </head>
9
9
  <body>
10
10
 
@@ -1,5 +1,6 @@
1
1
  module Bookshop
2
2
  module Generators
3
+ #
3
4
  class GeneratorGenerator < NamedBase
4
5
  check_class_collision :suffix => "Generator"
5
6
 
@@ -1,3 +1,3 @@
1
1
  module Bookshop
2
- VERSION = "0.0.14"
2
+ VERSION = "0.0.15"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: bookshop
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.14
5
+ version: 0.0.15
6
6
  platform: ruby
7
7
  authors:
8
8
  - D.a. Thompson
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-11-28 00:00:00 Z
13
+ date: 2011-12-02 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: thor
@@ -86,13 +86,12 @@ files:
86
86
  - lib/bookshop/generators/bookshop/app/app_generator.rb
87
87
  - lib/bookshop/generators/bookshop/app/templates/CHANGELOG
88
88
  - lib/bookshop/generators/bookshop/app/templates/README.rdoc
89
- - lib/bookshop/generators/bookshop/app/templates/book/META_INF/container.xml
90
- - lib/bookshop/generators/bookshop/app/templates/book/book.html
91
- - lib/bookshop/generators/bookshop/app/templates/book/css/boom.css
89
+ - lib/bookshop/generators/bookshop/app/templates/book/book.html.erb
90
+ - lib/bookshop/generators/bookshop/app/templates/book/css/stylesheet.css
92
91
  - lib/bookshop/generators/bookshop/app/templates/book/images/canvas.jpg
93
92
  - lib/bookshop/generators/bookshop/app/templates/book/images/html-18.png
94
- - lib/bookshop/generators/bookshop/app/templates/book/mimetype
95
93
  - lib/bookshop/generators/bookshop/app/templates/builds/epub/.empty_directory
94
+ - lib/bookshop/generators/bookshop/app/templates/builds/html/.empty_directory
96
95
  - lib/bookshop/generators/bookshop/app/templates/builds/mobi/.empty_directory
97
96
  - lib/bookshop/generators/bookshop/app/templates/builds/pdf/.empty_directory
98
97
  - lib/bookshop/generators/bookshop/app/templates/config/application.rb
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" ?>
2
- <container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
3
- <rootfiles>
4
- <rootfile full-path="OEBPS/content.opf" media-type="application/oebps-package+xml"/>
5
- </rootfiles>
6
- </container>
@@ -1 +0,0 @@
1
- application/epub+zip