wordsmith 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +7 -5
- data/README.md +101 -36
- data/lib/wordsmith/generate.rb +2 -2
- data/lib/wordsmith/version.rb +1 -1
- data/wordsmith.gemspec +17 -20
- metadata +46 -20
data/Gemfile.lock
CHANGED
@@ -2,17 +2,19 @@ PATH
|
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
4
|
wordsmith (0.0.1)
|
5
|
-
|
6
|
-
|
5
|
+
git
|
6
|
+
kindlegen (>= 2.3.1)
|
7
|
+
nokogiri (>= 1.5.2)
|
7
8
|
|
8
9
|
GEM
|
9
10
|
remote: http://rubygems.org/
|
10
11
|
specs:
|
11
|
-
|
12
|
+
git (1.2.5)
|
13
|
+
kindlegen (2.8.0)
|
12
14
|
systemu
|
13
|
-
nokogiri (1.5.
|
15
|
+
nokogiri (1.5.9)
|
14
16
|
rake (0.9.2.2)
|
15
|
-
systemu (2.5.
|
17
|
+
systemu (2.5.2)
|
16
18
|
test-unit (2.4.8)
|
17
19
|
|
18
20
|
PLATFORMS
|
data/README.md
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
## What is it about?
|
2
2
|
|
3
|
-
Wordsmith is a
|
4
|
-
|
3
|
+
Wordsmith is a Ruby framework with a built in command-line toolset to create,
|
4
|
+
share, publish and collaborate on e-books, guides, manuals, etc.
|
5
5
|
|
6
|
-
Through the command line interface, you can create a project repository
|
7
|
-
|
8
|
-
|
6
|
+
Through the command line interface, you can create a project repository with
|
7
|
+
a standard directory structure that allows you and your co-authors to easily
|
8
|
+
manage your content.
|
9
9
|
|
10
|
-
The command line interface provides a set of commands to export
|
10
|
+
The command line interface provides a set of commands to export
|
11
11
|
in the following formats:
|
12
|
-
|
12
|
+
|
13
13
|
* epub
|
14
14
|
* mobi
|
15
15
|
* pdf
|
@@ -17,6 +17,11 @@ in the following formats:
|
|
17
17
|
|
18
18
|
You can also publish your book to your github project page with a single command.
|
19
19
|
|
20
|
+
By the way, Wordsmith was heavily based on the [git-scribe][gitscribe] gem,
|
21
|
+
but with a few extra goodies such as painless installation.
|
22
|
+
|
23
|
+
[gitscribe]: https://github.com/schacon/git-scribe
|
24
|
+
|
20
25
|
## Installing
|
21
26
|
|
22
27
|
First of all, you should have [Pandoc][pandoc] installed in your system.
|
@@ -25,38 +30,52 @@ First of all, you should have [Pandoc][pandoc] installed in your system.
|
|
25
30
|
|
26
31
|
Next, install the wordsmith ruby gem.
|
27
32
|
|
28
|
-
gem install wordsmith
|
33
|
+
$ gem install wordsmith
|
29
34
|
|
30
35
|
Now you're good to go.
|
31
36
|
|
32
37
|
## Usage
|
33
38
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
39
|
+
$ wordsmith new [book name]
|
40
|
+
|
41
|
+
After that, Wordsmith will create a default directory structure so you just
|
42
|
+
need to start creating your own content without worrying about anything else.
|
43
|
+
|
44
|
+
book/
|
45
|
+
.wordsmith
|
46
|
+
layout/
|
47
|
+
header.html
|
48
|
+
footer.html
|
49
|
+
assets/
|
50
|
+
images/
|
51
|
+
cover.jpg
|
52
|
+
stylesheets/
|
53
|
+
default.css
|
54
|
+
book.css
|
55
|
+
content/
|
56
|
+
01_chapter_one.md
|
57
|
+
02_chapter_two.md
|
58
|
+
03_chapter_three/
|
59
|
+
01_lorem.md
|
60
|
+
02_ipsum.md
|
61
|
+
final/
|
62
|
+
book.epub
|
63
|
+
book.mobi
|
64
|
+
book.pdf
|
65
|
+
book/index.html
|
66
|
+
|
67
|
+
You can edit your book metadata inside the **.wordsmith** file:
|
68
|
+
|
69
|
+
---
|
70
|
+
edition: 0.1
|
71
|
+
language: en
|
72
|
+
author: Your Name
|
73
|
+
title: Your Book Title
|
74
|
+
cover: assets/images/cover.jpg
|
75
|
+
stylesheet: assets/stylesheets/default.css
|
76
|
+
|
77
|
+
The **layout** directory contains the header and footer for an
|
78
|
+
online version of your book.
|
60
79
|
|
61
80
|
The **assets** directory contains images and stylesheets.
|
62
81
|
|
@@ -65,5 +84,51 @@ In the **content** directory you can:
|
|
65
84
|
1. write content as single files
|
66
85
|
* use directories to easily manage long chapters
|
67
86
|
|
68
|
-
**Please note** that the file names in the 'content' folder must be
|
69
|
-
the chapter or section
|
87
|
+
**Please note** that the file names in the 'content' folder must be
|
88
|
+
snake cased and begin with the number of the chapter or section
|
89
|
+
(e.g. 01_chapter_one.md).
|
90
|
+
|
91
|
+
## To generate your book in different formats:
|
92
|
+
|
93
|
+
$ wordsmith generate [html|epub|mobi|pdf| ]
|
94
|
+
(don't pass any option to generate all formats at once)
|
95
|
+
|
96
|
+
## Publishing your books
|
97
|
+
|
98
|
+
You can also publish a pretty neat html version of your
|
99
|
+
book/manual/guide/etc. in github:
|
100
|
+
|
101
|
+
$ wordsmith publish git@github.com:jassa/wordsmith-demo.git
|
102
|
+
|
103
|
+
This will be available in a site like http://jassa.github.com/wordsmith-demo/
|
104
|
+
|
105
|
+
## REMEMBER
|
106
|
+
|
107
|
+
Git is an important part of this tool, a typical workflow should look like this:
|
108
|
+
|
109
|
+
$ wordsmith new ruby_guide
|
110
|
+
# this command will also create a git repository
|
111
|
+
# and the first commit, but IT WILL NOT BE PUSHED YET
|
112
|
+
# since you haven't provided a remote ref
|
113
|
+
|
114
|
+
$ cd ruby_guide
|
115
|
+
# Here you edit your 'content' directory with your own chapters
|
116
|
+
|
117
|
+
# then when you are ready to commit you do it normally:
|
118
|
+
$ wordsmith generate
|
119
|
+
$ git commit -am "finished chapter one"
|
120
|
+
|
121
|
+
# if you're not ready to publish to github pages, add a ref to a new repo
|
122
|
+
$ git add remote origin git@github.com:jassa/wordsmith-demo.git
|
123
|
+
$ git push origin master
|
124
|
+
|
125
|
+
# and if you are ready, you could do instead:
|
126
|
+
$ wordsmith publish git@github.com:jassa/wordsmith-demo.git
|
127
|
+
|
128
|
+
# This will create a branch called 'gh-pages' as github requires,
|
129
|
+
# you'll still need to run $ git push origin master
|
130
|
+
# to push your book editables
|
131
|
+
|
132
|
+
## License
|
133
|
+
|
134
|
+
Wordsmith is released under the [MIT License](http://www.opensource.org/licenses/MIT).
|
data/lib/wordsmith/generate.rb
CHANGED
@@ -8,7 +8,7 @@ class Wordsmith
|
|
8
8
|
@output = local(File.join('final', @name))
|
9
9
|
|
10
10
|
content_dir = local(File.join('content'))
|
11
|
-
@files = Dir.glob(content_dir + '/**/*.*').join(" \\\n")
|
11
|
+
@files = Dir.glob(content_dir + '/**/*.*').sort.join(" \\\n")
|
12
12
|
|
13
13
|
if @files.empty?
|
14
14
|
raise "Exiting.. Nothing to generate in #{content_dir}.\nHave you run 'wordsmith new'?"
|
@@ -129,4 +129,4 @@ class Wordsmith
|
|
129
129
|
$?.success?
|
130
130
|
end
|
131
131
|
end
|
132
|
-
end
|
132
|
+
end
|
data/lib/wordsmith/version.rb
CHANGED
data/wordsmith.gemspec
CHANGED
@@ -1,26 +1,23 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
$LOAD_PATH.unshift 'lib'
|
3
2
|
require 'wordsmith/version'
|
4
3
|
|
5
|
-
Gem::Specification.new do |
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.name = "wordsmith"
|
6
|
+
gem.version = Wordsmith::VERSION
|
7
|
+
gem.authors = ["Amed Rodriguez", "Javier Saldana", "Rene Cienfuegos"]
|
8
|
+
gem.email = ["amed@tractical.com", "javier@tractical.com", "rene@tractical.com"]
|
9
|
+
gem.homepage = "https://github.com/tractical/wordsmith"
|
10
|
+
gem.summary = "The best way to publish ebooks. No, really."
|
11
|
+
gem.description = "Create, collaborate and publish ebooks easily."
|
12
|
+
gem.executables = "wordsmith"
|
13
|
+
gem.license = "MIT"
|
14
14
|
|
15
|
-
|
15
|
+
gem.files = `git ls-files`.split("\n")
|
16
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
s.add_dependency('kindlegen')
|
23
|
-
s.add_dependency("git")
|
24
|
-
s.add_development_dependency("rake")
|
25
|
-
s.add_development_dependency("test-unit")
|
18
|
+
gem.add_dependency "nokogiri", ">= 1.5.2"
|
19
|
+
gem.add_dependency "kindlegen", ">= 2.3.1"
|
20
|
+
gem.add_dependency "git"
|
21
|
+
gem.add_development_dependency "rake"
|
22
|
+
gem.add_development_dependency "test-unit"
|
26
23
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wordsmith
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,33 +11,43 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2013-03-26 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: nokogiri
|
18
|
-
requirement:
|
18
|
+
requirement: !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
21
|
- - ! '>='
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version:
|
23
|
+
version: 1.5.2
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
|
-
version_requirements:
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
none: false
|
28
|
+
requirements:
|
29
|
+
- - ! '>='
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: 1.5.2
|
27
32
|
- !ruby/object:Gem::Dependency
|
28
33
|
name: kindlegen
|
29
|
-
requirement:
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
30
35
|
none: false
|
31
36
|
requirements:
|
32
37
|
- - ! '>='
|
33
38
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
39
|
+
version: 2.3.1
|
35
40
|
type: :runtime
|
36
41
|
prerelease: false
|
37
|
-
version_requirements:
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 2.3.1
|
38
48
|
- !ruby/object:Gem::Dependency
|
39
49
|
name: git
|
40
|
-
requirement:
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
41
51
|
none: false
|
42
52
|
requirements:
|
43
53
|
- - ! '>='
|
@@ -45,10 +55,15 @@ dependencies:
|
|
45
55
|
version: '0'
|
46
56
|
type: :runtime
|
47
57
|
prerelease: false
|
48
|
-
version_requirements:
|
58
|
+
version_requirements: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
60
|
+
requirements:
|
61
|
+
- - ! '>='
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
49
64
|
- !ruby/object:Gem::Dependency
|
50
65
|
name: rake
|
51
|
-
requirement:
|
66
|
+
requirement: !ruby/object:Gem::Requirement
|
52
67
|
none: false
|
53
68
|
requirements:
|
54
69
|
- - ! '>='
|
@@ -56,10 +71,15 @@ dependencies:
|
|
56
71
|
version: '0'
|
57
72
|
type: :development
|
58
73
|
prerelease: false
|
59
|
-
version_requirements:
|
74
|
+
version_requirements: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - ! '>='
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
60
80
|
- !ruby/object:Gem::Dependency
|
61
81
|
name: test-unit
|
62
|
-
requirement:
|
82
|
+
requirement: !ruby/object:Gem::Requirement
|
63
83
|
none: false
|
64
84
|
requirements:
|
65
85
|
- - ! '>='
|
@@ -67,12 +87,17 @@ dependencies:
|
|
67
87
|
version: '0'
|
68
88
|
type: :development
|
69
89
|
prerelease: false
|
70
|
-
version_requirements:
|
71
|
-
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
none: false
|
92
|
+
requirements:
|
93
|
+
- - ! '>='
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
description: Create, collaborate and publish ebooks easily.
|
72
97
|
email:
|
73
98
|
- amed@tractical.com
|
74
99
|
- javier@tractical.com
|
75
|
-
-
|
100
|
+
- rene@tractical.com
|
76
101
|
executables:
|
77
102
|
- wordsmith
|
78
103
|
extensions: []
|
@@ -108,7 +133,8 @@ files:
|
|
108
133
|
- test/test_helper.rb
|
109
134
|
- wordsmith.gemspec
|
110
135
|
homepage: https://github.com/tractical/wordsmith
|
111
|
-
licenses:
|
136
|
+
licenses:
|
137
|
+
- MIT
|
112
138
|
post_install_message:
|
113
139
|
rdoc_options: []
|
114
140
|
require_paths:
|
@@ -126,11 +152,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
152
|
- !ruby/object:Gem::Version
|
127
153
|
version: '0'
|
128
154
|
requirements: []
|
129
|
-
rubyforge_project:
|
130
|
-
rubygems_version: 1.8.
|
155
|
+
rubyforge_project:
|
156
|
+
rubygems_version: 1.8.23
|
131
157
|
signing_key:
|
132
158
|
specification_version: 3
|
133
|
-
summary:
|
159
|
+
summary: The best way to publish ebooks. No, really.
|
134
160
|
test_files:
|
135
161
|
- test/generate_test.rb
|
136
162
|
- test/init_test.rb
|