bookshop 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +11 -0
- data/MIT-LICENSE +1 -1
- data/README.rdoc +47 -14
- data/bookshop.gemspec +7 -8
- data/lib/bookshop/commands/build.rb +66 -3
- data/lib/bookshop/generators/bookshop/app/app_generator.rb +12 -1
- data/lib/bookshop/generators/bookshop/app/templates/README.rdoc +94 -18
- data/lib/bookshop/generators/bookshop/app/templates/book/book.xml +17 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/bookinfo.xml +22 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/ch00.xml +112 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/ch01.xml +194 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/ch02.xml +707 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/ch03.xml +2224 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/covers/.svn/all-wcprops +11 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/covers/.svn/entries +62 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/covers/.svn/prop-base/cover.jpg.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/covers/.svn/text-base/cover.jpg.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/covers/cover.jpg +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/covers/cover.pdf +4310 -13
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/all-wcprops +197 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/entries +1116 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/callouts.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/characterTool.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/commentview.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/docbook_duck.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/editReferenced.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/elementbar.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/figureInsert.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/figurePickFile2.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/fileref.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/hyperlink_print.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/hyperlink_web.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/insertcomment.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/keyCapWrap.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/lineannotations.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/linkFlow.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/linkend.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/promotedemote.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/search.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/secMenu.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/spell.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/svn_workflow_ongoing.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/svn_workflow_setup.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/tableID.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/tableInsert.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/treeView.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/ulink.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/universal_design_for_web_applications_cover.png.svn-base +5 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/untitled.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/urlAttribute.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/validation.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/viewMenu.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/prop-base/windowPrefs.png.svn-base +9 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/callouts.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/characterTool.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/commentview.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/docbook_duck.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/editReferenced.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/elementbar.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/figureInsert.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/figurePickFile2.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/fileref.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/hyperlink_print.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/hyperlink_web.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/insertcomment.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/keyCapWrap.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/lineannotations.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/linkFlow.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/linkend.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/promotedemote.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/search.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/secMenu.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/spell.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/svn_workflow_ongoing.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/svn_workflow_setup.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/tableID.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/tableInsert.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/treeView.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/ulink.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/universal_design_for_web_applications_cover.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/untitled.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/urlAttribute.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/validation.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/viewMenu.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/.svn/text-base/windowPrefs.png.svn-base +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/{images → figs}/bluehead_logo.gif +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/callouts.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/characterTool.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/commentview.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/docbook_duck.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/{images → figs}/draft.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/editReferenced.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/elementbar.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/figureInsert.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/figurePickFile2.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/fileref.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/hyperlink_print.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/hyperlink_web.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/insertcomment.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/keyCapWrap.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/lineannotations.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/linkFlow.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/linkend.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/promotedemote.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/search.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/secMenu.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/spell.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/svn_workflow_ongoing.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/svn_workflow_setup.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/tableID.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/tableInsert.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/treeView.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/ulink.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/universal_design_for_web_applications_cover.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/untitled.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/urlAttribute.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/validation.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/viewMenu.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/book/figs/windowPrefs.png +0 -0
- data/lib/bookshop/generators/bookshop/app/templates/stylesheets/html-stylesheet.xsl.tt +1 -1
- data/lib/bookshop/generators/bookshop/app/tools/java/epubcheck-1.2.jar +0 -0
- data/lib/bookshop/generators/bookshop/app/tools/java/lib/jing.jar +0 -0
- data/lib/bookshop/generators/bookshop/app/tools/java/lib/saxon.jar +0 -0
- data/lib/bookshop/generators/bookshop/app/tools/java/serializer.jar +0 -0
- data/lib/bookshop/generators/bookshop/app/tools/java/xalan.jar +0 -0
- data/lib/bookshop/generators/bookshop/app/tools/java/xercesImpl.jar +0 -0
- data/lib/bookshop/generators/bookshop/app/tools/java/{xml-apis-1.3.04.jar → xml-apis.jar} +0 -0
- data/lib/bookshop/generators/bookshop/app/tools/java/xsltc.jar +0 -0
- data/lib/bookshop/generators/bookshop/app/tools/kindle/kindlegen +0 -0
- data/lib/bookshop/version.rb +1 -1
- metadata +134 -26
- data/lib/bookshop/generators/bookshop/app/templates/book/book.xml.tt +0 -93
- data/lib/bookshop/generators/bookshop/app/templates/book/ch01_put_short_title_here.xml +0 -28
- data/lib/bookshop/generators/bookshop/app/templates/book/dedication.xml +0 -10
- data/lib/bookshop/generators/bookshop/app/templates/builds/html/.empty_directory +0 -0
- data/lib/bookshop/generators/bookshop/app/tools/java/serializer-2.7.0.jar +0 -0
- data/lib/bookshop/generators/bookshop/app/tools/java/xalan-2.7.0.jar +0 -0
- data/lib/bookshop/generators/bookshop/app/tools/java/xercesImpl-2.7.1.jar +0 -0
data/CHANGELOG
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
0.0.4:
|
2
|
+
Core Changes
|
3
|
+
Added new mobi build
|
4
|
+
|
5
|
+
Branding around World Uniting Press
|
6
|
+
|
7
|
+
Added epubcheck for epub validations, v1.2
|
8
|
+
|
9
|
+
Added kindlegen for generating mobi
|
10
|
+
|
11
|
+
|
1
12
|
0.0.3:
|
2
13
|
Core Changes
|
3
14
|
Added Java toolsets, including all necessary .jars for working with Docbook and
|
data/MIT-LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (C) 2010, 2011 by
|
1
|
+
Copyright (C) 2010, 2011 by World Uniting (http://worlduniting.org)
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.rdoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
== Welcome to bookshop
|
2
2
|
|
3
|
-
|
3
|
+
bookShop is an OSS ruby-based framework for docbook 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 DocBook-to-Output flows, by favoring convention over configuration, setting them up with best practices from the get-go.
|
4
4
|
|
5
5
|
bookshop hopes to simplify the process by:
|
6
6
|
* providing a Ruby Gem to make working with DocBook as easy as 'sudo gem install bookshop'
|
@@ -9,7 +9,11 @@ bookshop hopes to simplify the process by:
|
|
9
9
|
* providing an architecture/structure that follows best-practices and simplification (DRY... Don't Repeat Yourself)
|
10
10
|
* providing an extendable framework for other developers to add their own custom templates (and hopefully provide them for the community)
|
11
11
|
|
12
|
-
==
|
12
|
+
== Getting Started
|
13
|
+
|
14
|
+
Some Useful Links For Docs, Info, Resources to help use use bookshop, or contribute as a developer to this gem.
|
15
|
+
|
16
|
+
http://www.delicious.com/blueheadpublishing/bookshop
|
13
17
|
|
14
18
|
=== System Requirements
|
15
19
|
|
@@ -19,27 +23,56 @@ bookshop hopes to simplify the process by:
|
|
19
23
|
|
20
24
|
=== Install bookshop
|
21
25
|
|
22
|
-
|
26
|
+
$ sudo gem install bookshop
|
23
27
|
|
24
28
|
=== Create a bookshop application
|
25
29
|
|
26
|
-
|
30
|
+
$ bookshop new name_of_application
|
31
|
+
|
32
|
+
This will create a new bookshop app in /path/to/name_of_application
|
33
|
+
|
34
|
+
* 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):
|
27
35
|
|
28
|
-
|
36
|
+
PATH="$PATH:/var/lib/gems/1.8/bin"
|
37
|
+
export PATH
|
29
38
|
|
39
|
+
|
30
40
|
=== Install the java tools. All of the java tools (.jars, etc) can be found in /tools/java/ in the new application.
|
31
41
|
|
32
42
|
* For Mac you should copy the contents of /tools/java/ into your system /Library/Java/Extensions or your user ~/Library/Java/Extensions folder. This is the default location for the Java Classpath
|
33
43
|
|
34
|
-
* For *nix systems, you can define your classpath by creating a CLASSPATH variable in your .
|
35
|
-
|
36
|
-
|
44
|
+
* For *nix systems, you can define your classpath by creating a CLASSPATH variable in your .bashrc (or whatever shell/profile you are using). This example is for Ubuntu 10.10. Make sure to substitute:
|
45
|
+
|
46
|
+
CLASSPATH="/path/to/name_of_application/tools/java/fop.jar:\
|
47
|
+
/path/to/name_of_application/tools/java/avalon-framework-4.2.0.jar:\
|
48
|
+
/path/to/name_of_application/tools/java/xalan.jar:\
|
49
|
+
/path/to/name_of_application/tools/java/batik-all-1.7.jar:\
|
50
|
+
/path/to/name_of_application/tools/java/commons-io-1.3.1.jar:\
|
51
|
+
/path/to/name_of_application/tools/java/commons-logging-1.0.4.jar:\
|
52
|
+
/path/to/name_of_application/tools/java/fop-hyph.jar:\
|
53
|
+
/path/to/name_of_application/tools/java/jai-codec.jar:\
|
54
|
+
/path/to/name_of_application/tools/java/jai_core.jar:\
|
55
|
+
/path/to/name_of_application/tools/java/serializer.jar:\
|
56
|
+
/path/to/name_of_application/tools/java/xercesImpl.jar:\
|
57
|
+
/path/to/name_of_application/tools/java/xml-apis.jar:\
|
58
|
+
/path/to/name_of_application/tools/java/xmlgraphics-commons-1.4.jar"
|
59
|
+
export CLASSPATH
|
37
60
|
|
38
61
|
* For Windows systems you can either use Cygwin and follow the directions for *nix systems above, or edit your Classpath via the Control Panel
|
39
62
|
|
63
|
+
=== Building Your First Book
|
64
|
+
|
65
|
+
To build a pdf format of your book from the docbook source:
|
66
|
+
|
67
|
+
bookshop build pdf
|
68
|
+
|
69
|
+
To build an epub format of your book from the docbook source:
|
70
|
+
|
71
|
+
bookshop build epub
|
72
|
+
|
40
73
|
== Getting Help
|
41
74
|
|
42
|
-
* Checkout the wiki page which is in development currently for installation help and links to other articles and help content. https://github.com/
|
75
|
+
* Checkout the wiki page which is in development currently for installation help and links to other articles and help content. https://github.com/worlduniting/bookshop/wiki
|
43
76
|
|
44
77
|
* 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
|
45
78
|
|
@@ -73,12 +106,12 @@ The default directory structure of a generated bookshop app:
|
|
73
106
|
| |-- epub
|
74
107
|
| |-- html
|
75
108
|
| |-- mobi
|
76
|
-
|
109
|
+
| `-- pdf
|
77
110
|
|-- stylesheets
|
78
111
|
|-- tools
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
112
|
+
| |-- dtd
|
113
|
+
| |-- xsl
|
114
|
+
| `-- java
|
82
115
|
|
83
116
|
book
|
84
117
|
Holds all the manuscript DocBook code/files. This is where your master manuscript lives from which everything is built.
|
@@ -106,7 +139,7 @@ tools
|
|
106
139
|
|
107
140
|
== Copyright (MIT-LICENSE)
|
108
141
|
|
109
|
-
Copyright (C) 2010, 2011 by
|
142
|
+
Copyright (C) 2010, 2011 by World Uniting (http://worlduniting.org)
|
110
143
|
|
111
144
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
112
145
|
of this software and associated documentation files (the "Software"), to deal
|
data/bookshop.gemspec
CHANGED
@@ -5,16 +5,15 @@ Gem::Specification.new do |s|
|
|
5
5
|
s.name = "bookshop"
|
6
6
|
s.version = Bookshop::VERSION
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
|
-
s.authors = ['D.
|
9
|
-
s.email = ['
|
8
|
+
s.authors = ['D.a. Thompson']
|
9
|
+
s.email = ['git@worlduniting.org']
|
10
10
|
s.homepage = "http://rubygems.org/gems/bookshop"
|
11
|
-
s.summary = "
|
12
|
-
s.description = "bookShop is an
|
13
|
-
|
14
|
-
|
15
|
-
develop their DocBook-to-Output flows, by favoring convention over
|
11
|
+
s.summary = "An OSS Ruby-Based Framework for DocBook Toolchain Happiness and Sustainable Productivity."
|
12
|
+
s.description = "bookShop is an OSS ruby-based framework for docbook toolchain happiness and sustainable productivity.
|
13
|
+
The framework is optimized to help developers quickly ramp-up, allowing them to more rapidly
|
14
|
+
jump in and develop their DocBook-to-Output flows, by favoring convention over
|
16
15
|
configuration, setting them up with best practices, standards and
|
17
|
-
tools from the get-go."
|
16
|
+
tools from the get-go. This gem is brought to you by World Uniting Press, a division of World Uniting."
|
18
17
|
|
19
18
|
s.required_rubygems_version = ">= 1.3.6"
|
20
19
|
s.rubyforge_project = "bookshop"
|
@@ -24,18 +24,79 @@ module Bookshop
|
|
24
24
|
|
25
25
|
case build
|
26
26
|
when 'pdf'
|
27
|
-
puts "Deleting
|
27
|
+
puts "Deleting any old builds"
|
28
28
|
File.delete("builds/pdf/book.pdf") if File::exists?( "builds/pdf/book.pdf" )
|
29
29
|
puts "File Deleted"
|
30
30
|
puts "Building new pdf at builds/pdf/book.pdf"
|
31
|
-
cmd = %x[java
|
31
|
+
cmd = %x[java -jar tools/java/fop.jar -xml book/book.xml -xsl stylesheets/fo-stylesheet.xsl builds/pdf/book.pdf]
|
32
32
|
|
33
33
|
when 'epub'
|
34
|
-
puts "Deleting
|
34
|
+
puts "Deleting any old builds"
|
35
|
+
File.delete("builds/epub/book.epub") if File::exists?( "builds/epub/book.epub" )
|
36
|
+
puts "File Deleted"
|
37
|
+
|
38
|
+
puts "Building new epub at builds/epub/book.epub"
|
39
|
+
cmd = %x[tools/xsl/epub/bin/dbtoepub -v book/book.xml -o builds/epub/book.epub]
|
40
|
+
|
41
|
+
puts "Validating epub"
|
42
|
+
cmd = %x[java -jar tools/java/epubcheck-1.2.jar builds/epub/book.epub]
|
43
|
+
|
44
|
+
|
45
|
+
# fix this
|
46
|
+
when 'mobi'
|
47
|
+
puts "Deleting any old builds"
|
48
|
+
File.delete("builds/mobi/book.*") if File::exists?( "builds/mobi/book.*" )
|
49
|
+
puts "File Deleted"
|
50
|
+
|
51
|
+
puts "Building new epub at builds/mobi/book.epub"
|
52
|
+
cmd = %x[tools/xsl/epub/bin/dbtoepub -v book/book.xml -o builds/mobi/book.epub]
|
53
|
+
|
54
|
+
puts "Validating epub"
|
55
|
+
cmd = %x[java -jar tools/java/epubcheck-1.2.jar builds/mobi/book.epub]
|
56
|
+
|
57
|
+
puts "Generating mobi file at builds/mobi/book.mobi"
|
58
|
+
cmd = %x[tools/kindle/kindlegen builds/mobi/book.epub]
|
59
|
+
|
60
|
+
puts "Cleaning up..."
|
61
|
+
File.delete("builds/mobi/book.epub") if File::exists?( "builds/mobi/book.epub" )
|
62
|
+
|
63
|
+
# to be fixed
|
64
|
+
|
65
|
+
# when 'html'
|
66
|
+
# puts "Deleting your old html build"
|
67
|
+
# File.delete("builds/html/book.html") if File::exists?( "builds/html/book.html" )
|
68
|
+
# puts "File Deleted"
|
69
|
+
|
70
|
+
# puts "Building new html at builds/html/book.html"
|
71
|
+
# cmd = %x[java -jar tools/java/xalan.jar -in book/book.xml -xsl stylesheets/html-stylesheet.xsl -out builds/html/book.html]
|
72
|
+
|
73
|
+
when 'all'
|
74
|
+
puts "Building pdf..."
|
75
|
+
puts "Deleting any old builds"
|
76
|
+
File.delete("builds/pdf/book.pdf") if File::exists?( "builds/pdf/book.pdf" )
|
77
|
+
puts "File Deleted"
|
78
|
+
puts "Building new pdf at builds/pdf/book.pdf"
|
79
|
+
cmd = %x[java -jar tools/java/fop.jar -xml book/book.xml -xsl stylesheets/fo-stylesheet.xsl builds/pdf/book.pdf]
|
80
|
+
|
81
|
+
puts "Building epub..."
|
82
|
+
puts "Deleting any old builds"
|
35
83
|
File.delete("builds/epub/book.epub") if File::exists?( "builds/epub/book.epub" )
|
36
84
|
puts "File Deleted"
|
37
85
|
puts "Building new pdf at builds/epub/book.epub"
|
38
86
|
cmd = %x[tools/xsl/epub/bin/dbtoepub -v book/book.xml -o builds/epub/book.epub]
|
87
|
+
|
88
|
+
puts "Building mobi..."
|
89
|
+
puts "Deleting any old builds"
|
90
|
+
File.delete("builds/mobi/book.*") if File::exists?( "builds/mobi/book.*" )
|
91
|
+
puts "File Deleted"
|
92
|
+
puts "Building new epub at builds/mobi/book.epub"
|
93
|
+
cmd = %x[tools/xsl/epub/bin/dbtoepub -v book/book.xml -o builds/mobi/book.epub]
|
94
|
+
puts "Validating epub"
|
95
|
+
cmd = %x[java -jar tools/java/epubcheck-1.2.jar builds/mobi/book.epub]
|
96
|
+
puts "Generating mobi file at builds/mobi/book.mobi"
|
97
|
+
cmd = %x[tools/kindle/kindlegen builds/mobi/book.epub]
|
98
|
+
puts "Cleaning up..."
|
99
|
+
File.delete("builds/mobi/book.epub") if File::exists?( "builds/mobi/book.epub" )
|
39
100
|
|
40
101
|
else
|
41
102
|
puts "Error: Command not recognized" unless %w(-h --help).include?(build)
|
@@ -45,6 +106,8 @@ module Bookshop
|
|
45
106
|
The most common build commands are:
|
46
107
|
pdf Builds a new pdf at /builds/pdf/book.pdf
|
47
108
|
epub Builds a new epub at /builds/epub/book.epub
|
109
|
+
html Builds a new html at /builds/html/book.html
|
110
|
+
all Builds all possible builds in their respective locations
|
48
111
|
|
49
112
|
All commands can be run with -h for more information.
|
50
113
|
EOT
|
@@ -12,7 +12,7 @@ module Bookshop
|
|
12
12
|
|
13
13
|
|
14
14
|
class_option :dtd, :type => :string, :aliases => "-dtd",
|
15
|
-
:desc => "DTD version [ 4.5, 5.0 ]", :default => "5
|
15
|
+
:desc => "DTD version [ 4.5, 5.0 ]", :default => "4.5"
|
16
16
|
|
17
17
|
class_option :xsl, :type => :string, :aliases => "-xsl",
|
18
18
|
:desc => "DocBook-XSL version [ 1.75.2, 1.76.1 ]", :default => "1.76.1"
|
@@ -24,11 +24,13 @@ module Bookshop
|
|
24
24
|
|
25
25
|
# Create the project from templates
|
26
26
|
def create_base_project
|
27
|
+
puts "creating base project"
|
27
28
|
directory "templates", "#{app_path}"
|
28
29
|
end
|
29
30
|
|
30
31
|
# Adds the dtd specified by user
|
31
32
|
def add_dtd
|
33
|
+
puts "creating dtd"
|
32
34
|
dtd = "#{options[:dtd]}"
|
33
35
|
directory "tools/dtd/#{options[:dtd]}", "#{app_path}/tools/dtd"
|
34
36
|
end
|
@@ -48,6 +50,15 @@ module Bookshop
|
|
48
50
|
directory "tools/java/", "#{app_path}/tools/java"
|
49
51
|
end
|
50
52
|
|
53
|
+
# Add the Kindlegen dependencies
|
54
|
+
def add_kindle
|
55
|
+
directory "tools/kindle/", "#{app_path}/tools/kindle"
|
56
|
+
end
|
57
|
+
|
58
|
+
# Change the permissions so kindlegen is executable
|
59
|
+
def chmod_kindlegen
|
60
|
+
chmod "#{app_path}/tools/kindle/kindlegen", 0755
|
61
|
+
end
|
51
62
|
protected
|
52
63
|
|
53
64
|
def self.banner
|
@@ -1,41 +1,117 @@
|
|
1
|
-
== Welcome to
|
1
|
+
== Welcome to bookshop
|
2
2
|
|
3
|
-
bookShop is an
|
3
|
+
bookShop is an OSS ruby-based framework for docbook 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 DocBook-to-Output flows, by favoring convention over configuration, setting them up with best practices from the get-go.
|
4
4
|
|
5
|
-
|
6
|
-
* providing a Ruby Gem to make working with DocBook as easy as 'sudo gem install
|
7
|
-
* pulling all the DocBook tools together into one place
|
5
|
+
bookshop hopes to simplify the process by:
|
6
|
+
* providing a Ruby Gem to make working with DocBook as easy as 'sudo gem install bookshop'
|
7
|
+
* pulling all the DocBook tools together into one place (DocBook DTD, XSL Stylesheets, XSLT Processor, XSL-FO Processor)
|
8
8
|
* giving the developer a set of scripts to automate the redundant stuff
|
9
9
|
* providing an architecture/structure that follows best-practices and simplification (DRY... Don't Repeat Yourself)
|
10
10
|
* providing an extendable framework for other developers to add their own custom templates (and hopefully provide them for the community)
|
11
11
|
|
12
12
|
== Getting Started
|
13
13
|
|
14
|
-
|
14
|
+
Some Useful Links For Docs, Info, Resources to help use use bookshop, or contribute as a developer to this gem.
|
15
15
|
|
16
|
-
|
16
|
+
http://www.delicious.com/blueheadpublishing/bookshop
|
17
17
|
|
18
|
-
|
18
|
+
=== System Requirements
|
19
19
|
|
20
|
-
|
20
|
+
* Ruby v1.8.7 or v1.9.2 http://www.ruby-lang.org/en/downloads/
|
21
|
+
* Rubygems v1.3.6 http://docs.rubygems.org/read/chapter/3
|
22
|
+
* Java v1.6 http://www.java.com/
|
21
23
|
|
22
|
-
|
24
|
+
=== Install bookshop
|
23
25
|
|
24
|
-
|
26
|
+
$ sudo gem install bookshop
|
25
27
|
|
26
|
-
|
28
|
+
=== Create a bookshop application
|
29
|
+
|
30
|
+
$ bookshop new name_of_application
|
31
|
+
|
32
|
+
This will create a new bookshop app in /path/to/name_of_application
|
33
|
+
|
34
|
+
* 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):
|
35
|
+
|
36
|
+
PATH="$PATH:/var/lib/gems/1.8/bin"
|
37
|
+
export PATH
|
38
|
+
|
39
|
+
|
40
|
+
=== Install the java tools. All of the java tools (.jars, etc) can be found in /tools/java/ in the new application.
|
41
|
+
|
42
|
+
* For Mac you should copy the contents of /tools/java/ into your system /Library/Java/Extensions or your user ~/Library/Java/Extensions folder. This is the default location for the Java Classpath
|
43
|
+
|
44
|
+
* For *nix systems, you can define your classpath by creating a CLASSPATH variable in your .bashrc (or whatever shell/profile you are using). This example is for Ubuntu 10.10. Make sure to substitute:
|
45
|
+
|
46
|
+
CLASSPATH="/path/to/name_of_application/tools/java/fop.jar:\
|
47
|
+
/path/to/name_of_application/tools/java/avalon-framework-4.2.0.jar:\
|
48
|
+
/path/to/name_of_application/tools/java/xalan.jar:\
|
49
|
+
/path/to/name_of_application/tools/java/batik-all-1.7.jar:\
|
50
|
+
/path/to/name_of_application/tools/java/commons-io-1.3.1.jar:\
|
51
|
+
/path/to/name_of_application/tools/java/commons-logging-1.0.4.jar:\
|
52
|
+
/path/to/name_of_application/tools/java/fop-hyph.jar:\
|
53
|
+
/path/to/name_of_application/tools/java/jai-codec.jar:\
|
54
|
+
/path/to/name_of_application/tools/java/jai_core.jar:\
|
55
|
+
/path/to/name_of_application/tools/java/serializer.jar:\
|
56
|
+
/path/to/name_of_application/tools/java/xercesImpl.jar:\
|
57
|
+
/path/to/name_of_application/tools/java/xml-apis.jar:\
|
58
|
+
/path/to/name_of_application/tools/java/xmlgraphics-commons-1.4.jar"
|
59
|
+
export CLASSPATH
|
60
|
+
|
61
|
+
* For Windows systems you can either use Cygwin and follow the directions for *nix systems above, or edit your Classpath via the Control Panel
|
62
|
+
|
63
|
+
=== Building Your First Book
|
64
|
+
|
65
|
+
To build a pdf format of your book from the docbook source:
|
66
|
+
|
67
|
+
bookshop build pdf
|
68
|
+
|
69
|
+
To build an epub format of your book from the docbook source:
|
70
|
+
|
71
|
+
bookshop build epub
|
72
|
+
|
73
|
+
== Getting Help
|
74
|
+
|
75
|
+
* Checkout the wiki page which is in development currently for installation help and links to other articles and help content. https://github.com/blueheadpublishing/bookshop/wiki
|
76
|
+
|
77
|
+
* 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
|
78
|
+
|
79
|
+
== Thanks
|
80
|
+
|
81
|
+
We would like to thank:
|
82
|
+
|
83
|
+
* The Xerces Team
|
84
|
+
* The DocBook Team
|
85
|
+
* The Ruby/Rubygems Team
|
86
|
+
|
87
|
+
== Description of Gem Contents
|
88
|
+
|
89
|
+
The basic bookshop gem architecture:
|
90
|
+
|
91
|
+
|-- bin
|
92
|
+
|-- lib
|
93
|
+
|
94
|
+
bin
|
95
|
+
command file copied to /usr/bin upon installation (which is then called from the command line)
|
96
|
+
|
97
|
+
lib
|
98
|
+
bookshop gem library files
|
99
|
+
|
100
|
+
== Description of bookshop app contents
|
101
|
+
|
102
|
+
The default directory structure of a generated bookshop app:
|
27
103
|
|
28
104
|
|-- book
|
29
105
|
|-- builds
|
30
106
|
| |-- epub
|
31
107
|
| |-- html
|
32
108
|
| |-- mobi
|
33
|
-
|
109
|
+
| `-- pdf
|
34
110
|
|-- stylesheets
|
35
111
|
|-- tools
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
112
|
+
| |-- dtd
|
113
|
+
| |-- xsl
|
114
|
+
| `-- java
|
39
115
|
|
40
116
|
book
|
41
117
|
Holds all the manuscript DocBook code/files. This is where your master manuscript lives from which everything is built.
|
@@ -60,10 +136,10 @@ stylesheets
|
|
60
136
|
|
61
137
|
tools
|
62
138
|
Holds the DocBook DTD, DocBook-XSL specs and Java tools which serve as the base for building formats. Customization should not happen here, but rather with the stylesheets in the "stylesheets" folder. Files here should remain largely unchanged unless you know what you are doing.
|
63
|
-
|
139
|
+
|
64
140
|
== Copyright (MIT-LICENSE)
|
65
141
|
|
66
|
-
Copyright (C) 2010, 2011 by
|
142
|
+
Copyright (C) 2010, 2011 by BlueHead Publishing LLC (http://blueheadpublishing.com)
|
67
143
|
|
68
144
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
69
145
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
3
|
+
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
|
4
|
+
<book>
|
5
|
+
<title>bookshop</title>
|
6
|
+
<subtitle>the un-ultimate guide to docbook authoring</subtitle>
|
7
|
+
|
8
|
+
<xi:include href="bookinfo.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
|
9
|
+
|
10
|
+
<xi:include href="ch00.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
|
11
|
+
|
12
|
+
<xi:include href="ch01.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
|
13
|
+
|
14
|
+
<xi:include href="ch02.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
|
15
|
+
|
16
|
+
<xi:include href="ch03.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
|
17
|
+
</book>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE bookinfo PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
3
|
+
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
|
4
|
+
<bookinfo>
|
5
|
+
<!-- All rights reserved. -->
|
6
|
+
|
7
|
+
<edition>1</edition>
|
8
|
+
|
9
|
+
<author>
|
10
|
+
<othername>D.a. Thompson</othername>
|
11
|
+
|
12
|
+
<email>press@worlduniting.org</email>
|
13
|
+
</author>
|
14
|
+
|
15
|
+
<!--Markup for downstream formats; not necessary to add at the manuscript phase-->
|
16
|
+
<mediaobject id="coverd1e4" role="cover">
|
17
|
+
<imageobject remap="lrg" role="front-large">
|
18
|
+
<imagedata fileref="covers/cover.jpg" format="JPG"/>
|
19
|
+
</imageobject>
|
20
|
+
</mediaobject>
|
21
|
+
|
22
|
+
</bookinfo>
|
@@ -0,0 +1,112 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE preface PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
3
|
+
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
|
4
|
+
<preface>
|
5
|
+
<title>Getting Started</title>
|
6
|
+
|
7
|
+
<para><ulink url="http://docbook.org">DocBook</ulink> is an OASIS standard
|
8
|
+
for XML that is ideal for writing long, technical documents that have
|
9
|
+
complex structure and cross-references. With its semantic tagging, DocBook
|
10
|
+
can be rendered as PDF for printing, HTML, <literal
|
11
|
+
moreinfo="none">man</literal> pages, audio, or even Braille. This
|
12
|
+
versatility and <phrase role="keep-together">reusability</phrase> make
|
13
|
+
DocBook 4.5 XML the preferred format for <phrase
|
14
|
+
role="keep-together">O’Reilly</phrase> books.</para>
|
15
|
+
|
16
|
+
<para id="getting_started">Not only does this document explain how to start
|
17
|
+
writing in DocBook, but it was created using the same markup and toolchain
|
18
|
+
used for a typical O’Reilly book, so you can treat it as a model for your
|
19
|
+
own manuscript. <xref linkend="docbook_xml_markup_guidelines" /> contains
|
20
|
+
information about markup.</para>
|
21
|
+
|
22
|
+
<note>
|
23
|
+
<para>This document exists in two PDF forms: a print-friendly version
|
24
|
+
(<filename>docbookguidelines_print.pdf</filename>), which displays URLs in
|
25
|
+
parentheses after links, and a web-friendly version
|
26
|
+
(<filename>docbookguidelines_web.pdf</filename>), which displays links in
|
27
|
+
blue and hides the URLs. Please be aware that if you print out the
|
28
|
+
web-friendly version, you may not be able to tell where the links are. See
|
29
|
+
<xref linkend="web_pdfs" /> and <xref linkend="inserting_hyperlinks" />
|
30
|
+
for more about web versus print PDFs.</para>
|
31
|
+
</note>
|
32
|
+
|
33
|
+
<sect1>
|
34
|
+
<title>Why DocBook?</title>
|
35
|
+
|
36
|
+
<para>Why not troff? Why not LaTeX?</para>
|
37
|
+
|
38
|
+
<para>We’ve got nothing against LaTeX, troff, or any other formatting
|
39
|
+
markup system. But typesetting markup like LaTeX is inherently focused on
|
40
|
+
formatting—font size, margins, alignment, etc. We’d rather you spend your
|
41
|
+
time focused on the semantic structure of your book (how sections are
|
42
|
+
divided, which information goes in a sidebar versus a note, and so on),
|
43
|
+
and that’s where DocBook shines. In the same way most well-designed
|
44
|
+
websites separate content from formatting using XHTML and CSS (XHTML for
|
45
|
+
the content, and CSS for the formatting), DocBook lets us abstract
|
46
|
+
formatting decisions away from content decisions.</para>
|
47
|
+
|
48
|
+
<?dbfo-need height=”1in”
|
49
|
+
?>
|
50
|
+
|
51
|
+
<para>Particularly as O’Reilly expands its efforts to provide content in
|
52
|
+
multiple formats and at multiple stages of the content’s life cycle,
|
53
|
+
cost-effectively generating multiple, distinct output formats from the
|
54
|
+
same source document becomes critical, even though it means losing some
|
55
|
+
degree of granular control over the output.</para>
|
56
|
+
|
57
|
+
<para>What does that mean for your book? It means that you’ll be able to
|
58
|
+
view drafts of your book throughout the authoring process that are
|
59
|
+
formatted much as they will be for print, and it means once your book is
|
60
|
+
finished, it will go live almost immediately on <ulink
|
61
|
+
url="http://my.safaribooksonline.com/?portal=oreilly">Safari Books
|
62
|
+
Online</ulink> and other digital and ebook retail channels, rather than
|
63
|
+
needing to first be converted into DocBook from another format, which can
|
64
|
+
take a week or longer.</para>
|
65
|
+
</sect1>
|
66
|
+
|
67
|
+
<sect1>
|
68
|
+
<title>For More Information on DocBook</title>
|
69
|
+
|
70
|
+
<para>This guide is tailored specifically to help authors get the most out
|
71
|
+
of O’Reilly’s DocBook authoring toolchain. For more general information,
|
72
|
+
see Norm Walsh’s <ulink
|
73
|
+
url="http://www.docbook.org/tdg/en/html/docbook.html">DocBook: The
|
74
|
+
Definitive Guide</ulink>, an excellent online reference for DocBook
|
75
|
+
XML.<footnote>
|
76
|
+
<para>Although we’re publishing <citetitle><ulink
|
77
|
+
role="orm:hideurl:ital"
|
78
|
+
url="http://oreilly.com/catalog/9780596805012">DocBook 5: The
|
79
|
+
Definitive Guide</ulink></citetitle> any minute now, we’re sticking
|
80
|
+
with DocBook 4.5 for the foreseeable future.</para>
|
81
|
+
</footnote> You’ll find <ulink role="orm:hideurl"
|
82
|
+
url="http://www.docbook.org/tdg/en/html/part2.html">reference
|
83
|
+
pages</ulink> for every DocBook element, including its content model, a
|
84
|
+
description of its purpose, a list of parents that can contain the element
|
85
|
+
and children that can be nested in the element, and the attributes the
|
86
|
+
element takes. Other resources that may be helpful include:</para>
|
87
|
+
|
88
|
+
<itemizedlist>
|
89
|
+
<listitem>
|
90
|
+
<para><ulink url="http://www.docbook.org/">DocBook.org</ulink></para>
|
91
|
+
</listitem>
|
92
|
+
|
93
|
+
<listitem>
|
94
|
+
<para><ulink
|
95
|
+
url="http://www.dpawson.co.uk/docbook/reference.html">DocBook Basics
|
96
|
+
and References</ulink></para>
|
97
|
+
</listitem>
|
98
|
+
|
99
|
+
<listitem>
|
100
|
+
<para><ulink
|
101
|
+
url="http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">The
|
102
|
+
DocBook DTD</ulink></para>
|
103
|
+
</listitem>
|
104
|
+
|
105
|
+
<listitem>
|
106
|
+
<para><ulink
|
107
|
+
url="http://www.sagehill.net/docbookxsl/index.html">DocBook XSL: The
|
108
|
+
Complete Guide</ulink></para>
|
109
|
+
</listitem>
|
110
|
+
</itemizedlist>
|
111
|
+
</sect1>
|
112
|
+
</preface>
|