verku 0.14.1 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.rvmrc +0 -1
- data/Gemfile.lock +5 -7
- data/README.md +7 -17
- data/lib/verku/cli.rb +5 -5
- data/lib/verku/stats.rb +8 -45
- data/lib/verku/version.rb +1 -1
- data/templates/build.yml +2 -0
- data/templates/config.erb +2 -0
- data/verku.gemspec +0 -1
- metadata +42 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 33c19a92b0abfb0deafdfbc191739479542df70b
|
4
|
+
data.tar.gz: d29fec1bc639fe247f3592b615a11be143d457a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26511d876bb09207ccb015e5a93ab5b0355a7d781edb9617826f5466cd234e0d8b68b68af1e0508fd60a56b1f48d1e33248ba14a16b6e211affaa5bc8d0976d7
|
7
|
+
data.tar.gz: 9e979b24a2d8aee3692fec0a826406b21c2520627cdc65c0b2d0c963f8dc331977f856615200f7f06ef10023e6cbeec012b21c9f250f6864b1a6dd396267eec9
|
data/.rvmrc
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
use ruby-2.3.0
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
verku (0.
|
4
|
+
verku (0.15.0)
|
5
5
|
activesupport (~> 5.0, >= 5.0.0)
|
6
6
|
awesome_print (~> 0)
|
7
7
|
eeepub (~> 0)
|
@@ -31,14 +31,12 @@ GEM
|
|
31
31
|
i18n (0.7.0)
|
32
32
|
kramdown (0.14.2)
|
33
33
|
mini_portile2 (2.1.0)
|
34
|
-
minitest (5.9.
|
35
|
-
nokogiri (1.6.8)
|
34
|
+
minitest (5.9.1)
|
35
|
+
nokogiri (1.6.8.1)
|
36
36
|
mini_portile2 (~> 2.1.0)
|
37
|
-
pkg-config (~> 1.1.7)
|
38
37
|
notifier (0.5.2)
|
39
|
-
pkg-config (1.1.7)
|
40
38
|
psych (1.3.4)
|
41
|
-
rake (11.
|
39
|
+
rake (11.3.0)
|
42
40
|
rubyzip (1.2.0)
|
43
41
|
safe_yaml (1.0.4)
|
44
42
|
thor (0.19.1)
|
@@ -57,4 +55,4 @@ DEPENDENCIES
|
|
57
55
|
verku!
|
58
56
|
|
59
57
|
BUNDLED WITH
|
60
|
-
1.
|
58
|
+
1.13.6
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Verku
|
2
2
|
=========
|
3
3
|
|
4
|
-
Verku provides authors a free, ruby-based production toolchain for self-published paper and electronic books using the [LaTeX](http://www.latex-project.org/) document preparation system. The code base borrows heavily from [Kitabu](https://github.com/fnando/kitabu), while replacing [Prince](http://princexml.com) as the PDF generator
|
4
|
+
Verku provides authors a free, ruby-based production toolchain for self-published paper and electronic books using Markdown and the [LaTeX](http://www.latex-project.org/) document preparation system. The code base borrows heavily from [Kitabu](https://github.com/fnando/kitabu), while replacing [Prince](http://princexml.com) as the PDF generator. Use of Prince as recommended in Kitabu appears to me to violate the Prince license, and Prince itself is too expensive.
|
5
5
|
|
6
6
|
What Does Verku Provide?
|
7
7
|
----------------------------
|
@@ -46,7 +46,7 @@ To create a new Verku project, execute the following on the command line:
|
|
46
46
|
|
47
47
|
$ verku new mybook
|
48
48
|
|
49
|
-
This command creates a directory <tt>mybook</tt> with the following structure
|
49
|
+
This command creates a directory <tt>mybook</tt> with the following structure:
|
50
50
|
|
51
51
|
mybook
|
52
52
|
├── _verku.yml
|
@@ -65,27 +65,17 @@ This command creates a directory <tt>mybook</tt> with the following structure (m
|
|
65
65
|
│ ├── syntax.css
|
66
66
|
│ └── user.css
|
67
67
|
├── builds
|
68
|
-
|
68
|
+
├── docs
|
69
|
+
└── research other supporting documentation
|
70
|
+
└── text
|
69
71
|
└── 01_Chapter
|
70
72
|
└──01_Welcome.tex
|
71
73
|
|
72
74
|
The <tt>_verku.yml</tt> file holds the project's metadata. Update the relevant fields.
|
73
75
|
|
74
|
-
Now it's time to write your e-book. All your book content will be placed on the text directory. Verku requires you to separate your book into chapters. A chapter is nothing but a directory that holds lots of text files. The e-book will be generated using every folder/file alphabetically. So be sure to use a sequential numbering as the name.
|
75
|
-
|
76
|
-
* text
|
77
|
-
* 01_Introduction
|
78
|
-
* 01_introduction.tex
|
79
|
-
* 02_What_is_Ruby_on_Rails
|
80
|
-
* 01_MVC.tex
|
81
|
-
* 02_DRY.tex
|
82
|
-
* 03_Convention_Over_Configuration.tex
|
83
|
-
* 03_Installing_Ruby_on_Rails
|
84
|
-
* 01_Installing.tex
|
85
|
-
* 02_Mac_OS_X_instructions.tex
|
86
|
-
* 03_Windows_instructions.tex
|
87
|
-
* 04_Ubuntu_Linux_instructions.tex
|
76
|
+
Now it's time to write your e-book. All your book content will be placed on the text directory. Verku requires you to separate your book into chapters. A chapter is nothing but a directory that holds lots of text files. The e-book will be generated using every folder/file alphabetically. So be sure to use a sequential numbering as the name.
|
88
77
|
|
78
|
+
Chapter breaks rely on the use of Markdown headings, not directory/file structure.
|
89
79
|
|
90
80
|
When you're ready to view your progress, the commands below will compile the book into the <tt>output/</tt> directory in the appropriate format:
|
91
81
|
|
data/lib/verku/cli.rb
CHANGED
@@ -56,11 +56,11 @@ module Verku
|
|
56
56
|
|
57
57
|
say [
|
58
58
|
# "Chapters: #{stats.chapters}",
|
59
|
-
"Goal:
|
60
|
-
"Words:
|
61
|
-
"
|
62
|
-
"
|
63
|
-
"
|
59
|
+
"Goal: #{sprintf("%7d", stats.target)}",
|
60
|
+
"Words: #{sprintf("%7d", stats.words)}",
|
61
|
+
" -------",
|
62
|
+
"Remain: #{sprintf("%7d", stats.remaining)}",
|
63
|
+
"Progress: #{sprintf("%7d", stats.today)}"
|
64
64
|
].join("\n")
|
65
65
|
end
|
66
66
|
|
data/lib/verku/stats.rb
CHANGED
@@ -13,35 +13,30 @@ module Verku
|
|
13
13
|
|
14
14
|
def initialize(root_dir)
|
15
15
|
@root_dir = root_dir
|
16
|
-
@files = Dir["#{root_dir}/text/**/[0-9]*.
|
16
|
+
@files = Dir["#{root_dir}/text/**/[0-9]*.{md,markdown,mkd}"]
|
17
17
|
@words = 0
|
18
18
|
@progress = (File.exist?(log)) ? JSON.parse(File.open(log,'r').read).clone : {}
|
19
19
|
end
|
20
20
|
|
21
21
|
def log
|
22
|
-
"#{root_dir}/.
|
22
|
+
"#{root_dir}/.kalkulado"
|
23
23
|
end
|
24
24
|
|
25
25
|
def target
|
26
|
-
Verku.config(@root_dir)['wordcount']
|
26
|
+
Verku.config(@root_dir)['wordcount'] || 1000
|
27
27
|
end
|
28
28
|
def now
|
29
29
|
Date.today.to_s
|
30
30
|
end
|
31
31
|
def words
|
32
|
-
if @words == 0
|
32
|
+
if @words == 0
|
33
|
+
File.open(log,'w').write( JSON.generate(Hash.new) ) unless File.exist?(log)
|
34
|
+
|
33
35
|
most_recent = @files.max_by {|f| File.mtime(f)}
|
34
36
|
if !@progress[now].nil? and File.mtime(log) > File.mtime(most_recent)
|
35
37
|
@progress[now]
|
36
38
|
else
|
37
|
-
|
38
|
-
|
39
|
-
file = Tempfile.new('foo.tex')
|
40
|
-
file.write(text)
|
41
|
-
file.close
|
42
|
-
@progress[now] = `detex #{file.path}| wc -w`.to_i
|
43
|
-
file.unlink
|
44
|
-
# Do previous day's progress...if nil.
|
39
|
+
@progress[now] = text.split(/\s/).keep_if { |word| word.length > 0 }.count
|
45
40
|
@progress[Date.yesterday.to_s] = @progress[now] if @progress.keys.count == 1
|
46
41
|
end
|
47
42
|
end
|
@@ -50,7 +45,7 @@ module Verku
|
|
50
45
|
n = lasttime
|
51
46
|
w = @progress[lasttime]
|
52
47
|
n.upto(Date.yesterday.to_s) do |k|
|
53
|
-
|
48
|
+
puts "Upto #{k}: @progress[#{k}] = #{w}"
|
54
49
|
@progress[k] = w
|
55
50
|
end
|
56
51
|
end
|
@@ -78,37 +73,5 @@ module Verku
|
|
78
73
|
def remaining
|
79
74
|
target - words
|
80
75
|
end
|
81
|
-
|
82
|
-
# def html
|
83
|
-
# @html ||= Nokogiri::HTML(content)
|
84
|
-
# end
|
85
|
-
|
86
|
-
# def words
|
87
|
-
# @words ||= text.split(" ").size
|
88
|
-
# end
|
89
|
-
|
90
|
-
# def chapters
|
91
|
-
# @chapters ||= html.css(".chapter").size
|
92
|
-
# end
|
93
|
-
|
94
|
-
# def images
|
95
|
-
# @images ||= html.css("img").size
|
96
|
-
# end
|
97
|
-
|
98
|
-
# def footnotes
|
99
|
-
# @footnotes ||= html.css("p.footnote").size
|
100
|
-
# end
|
101
|
-
|
102
|
-
# def links
|
103
|
-
# @links ||= html.css("[href^='http']").size
|
104
|
-
# end
|
105
|
-
|
106
|
-
# def code_blocks
|
107
|
-
# @code_blocks ||= html.css("pre").size
|
108
|
-
# end
|
109
|
-
|
110
|
-
# def content
|
111
|
-
# @content ||= Parser::HTML.new(root_dir).content
|
112
|
-
# end
|
113
76
|
end
|
114
77
|
end
|
data/lib/verku/version.rb
CHANGED
data/templates/build.yml
ADDED
data/templates/config.erb
CHANGED
data/verku.gemspec
CHANGED
metadata
CHANGED
@@ -1,219 +1,219 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: verku
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Merovex
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.12'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.12'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: kramdown
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: psych
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '1.0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: activesupport
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - ~>
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '5.0'
|
76
|
-
- -
|
76
|
+
- - ">="
|
77
77
|
- !ruby/object:Gem::Version
|
78
78
|
version: 5.0.0
|
79
79
|
type: :runtime
|
80
80
|
prerelease: false
|
81
81
|
version_requirements: !ruby/object:Gem::Requirement
|
82
82
|
requirements:
|
83
|
-
- - ~>
|
83
|
+
- - "~>"
|
84
84
|
- !ruby/object:Gem::Version
|
85
85
|
version: '5.0'
|
86
|
-
- -
|
86
|
+
- - ">="
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: 5.0.0
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: rubyzip
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
|
-
- - ~>
|
93
|
+
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
95
|
version: '1.0'
|
96
|
-
- -
|
96
|
+
- - ">="
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: 1.0.0
|
99
99
|
type: :runtime
|
100
100
|
prerelease: false
|
101
101
|
version_requirements: !ruby/object:Gem::Requirement
|
102
102
|
requirements:
|
103
|
-
- - ~>
|
103
|
+
- - "~>"
|
104
104
|
- !ruby/object:Gem::Version
|
105
105
|
version: '1.0'
|
106
|
-
- -
|
106
|
+
- - ">="
|
107
107
|
- !ruby/object:Gem::Version
|
108
108
|
version: 1.0.0
|
109
109
|
- !ruby/object:Gem::Dependency
|
110
110
|
name: zip-zip
|
111
111
|
requirement: !ruby/object:Gem::Requirement
|
112
112
|
requirements:
|
113
|
-
- - ~>
|
113
|
+
- - "~>"
|
114
114
|
- !ruby/object:Gem::Version
|
115
115
|
version: '0'
|
116
116
|
type: :runtime
|
117
117
|
prerelease: false
|
118
118
|
version_requirements: !ruby/object:Gem::Requirement
|
119
119
|
requirements:
|
120
|
-
- - ~>
|
120
|
+
- - "~>"
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: '0'
|
123
123
|
- !ruby/object:Gem::Dependency
|
124
124
|
name: eeepub
|
125
125
|
requirement: !ruby/object:Gem::Requirement
|
126
126
|
requirements:
|
127
|
-
- - ~>
|
127
|
+
- - "~>"
|
128
128
|
- !ruby/object:Gem::Version
|
129
129
|
version: '0'
|
130
130
|
type: :runtime
|
131
131
|
prerelease: false
|
132
132
|
version_requirements: !ruby/object:Gem::Requirement
|
133
133
|
requirements:
|
134
|
-
- - ~>
|
134
|
+
- - "~>"
|
135
135
|
- !ruby/object:Gem::Version
|
136
136
|
version: '0'
|
137
137
|
- !ruby/object:Gem::Dependency
|
138
138
|
name: thor
|
139
139
|
requirement: !ruby/object:Gem::Requirement
|
140
140
|
requirements:
|
141
|
-
- - ~>
|
141
|
+
- - "~>"
|
142
142
|
- !ruby/object:Gem::Version
|
143
143
|
version: '0.19'
|
144
|
-
- -
|
144
|
+
- - ">="
|
145
145
|
- !ruby/object:Gem::Version
|
146
146
|
version: 0.19.1
|
147
147
|
type: :runtime
|
148
148
|
prerelease: false
|
149
149
|
version_requirements: !ruby/object:Gem::Requirement
|
150
150
|
requirements:
|
151
|
-
- - ~>
|
151
|
+
- - "~>"
|
152
152
|
- !ruby/object:Gem::Version
|
153
153
|
version: '0.19'
|
154
|
-
- -
|
154
|
+
- - ">="
|
155
155
|
- !ruby/object:Gem::Version
|
156
156
|
version: 0.19.1
|
157
157
|
- !ruby/object:Gem::Dependency
|
158
158
|
name: nokogiri
|
159
159
|
requirement: !ruby/object:Gem::Requirement
|
160
160
|
requirements:
|
161
|
-
- - ~>
|
161
|
+
- - "~>"
|
162
162
|
- !ruby/object:Gem::Version
|
163
163
|
version: '1.6'
|
164
|
-
- -
|
164
|
+
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: 1.6.0
|
167
167
|
type: :runtime
|
168
168
|
prerelease: false
|
169
169
|
version_requirements: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
|
-
- - ~>
|
171
|
+
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
173
|
version: '1.6'
|
174
|
-
- -
|
174
|
+
- - ">="
|
175
175
|
- !ruby/object:Gem::Version
|
176
176
|
version: 1.6.0
|
177
177
|
- !ruby/object:Gem::Dependency
|
178
178
|
name: notifier
|
179
179
|
requirement: !ruby/object:Gem::Requirement
|
180
180
|
requirements:
|
181
|
-
- - ~>
|
181
|
+
- - "~>"
|
182
182
|
- !ruby/object:Gem::Version
|
183
183
|
version: '0'
|
184
184
|
type: :runtime
|
185
185
|
prerelease: false
|
186
186
|
version_requirements: !ruby/object:Gem::Requirement
|
187
187
|
requirements:
|
188
|
-
- - ~>
|
188
|
+
- - "~>"
|
189
189
|
- !ruby/object:Gem::Version
|
190
190
|
version: '0'
|
191
191
|
- !ruby/object:Gem::Dependency
|
192
192
|
name: awesome_print
|
193
193
|
requirement: !ruby/object:Gem::Requirement
|
194
194
|
requirements:
|
195
|
-
- - ~>
|
195
|
+
- - "~>"
|
196
196
|
- !ruby/object:Gem::Version
|
197
197
|
version: '0'
|
198
198
|
type: :runtime
|
199
199
|
prerelease: false
|
200
200
|
version_requirements: !ruby/object:Gem::Requirement
|
201
201
|
requirements:
|
202
|
-
- - ~>
|
202
|
+
- - "~>"
|
203
203
|
- !ruby/object:Gem::Version
|
204
204
|
version: '0'
|
205
205
|
- !ruby/object:Gem::Dependency
|
206
206
|
name: safe_yaml
|
207
207
|
requirement: !ruby/object:Gem::Requirement
|
208
208
|
requirements:
|
209
|
-
- - ~>
|
209
|
+
- - "~>"
|
210
210
|
- !ruby/object:Gem::Version
|
211
211
|
version: '1.0'
|
212
212
|
type: :runtime
|
213
213
|
prerelease: false
|
214
214
|
version_requirements: !ruby/object:Gem::Requirement
|
215
215
|
requirements:
|
216
|
-
- - ~>
|
216
|
+
- - "~>"
|
217
217
|
- !ruby/object:Gem::Version
|
218
218
|
version: '1.0'
|
219
219
|
description: Verku provides authors a free, ruby-based production toolchain for self-published
|
@@ -227,9 +227,9 @@ extra_rdoc_files:
|
|
227
227
|
- LICENSE.md
|
228
228
|
- README.md
|
229
229
|
files:
|
230
|
-
- .document
|
231
|
-
- .gitignore
|
232
|
-
- .rvmrc
|
230
|
+
- ".document"
|
231
|
+
- ".gitignore"
|
232
|
+
- ".rvmrc"
|
233
233
|
- BUILD.md
|
234
234
|
- Gemfile
|
235
235
|
- Gemfile.lock
|
@@ -259,6 +259,7 @@ files:
|
|
259
259
|
- lib/verku/toc/epub.rb
|
260
260
|
- lib/verku/toc/html.rb
|
261
261
|
- lib/verku/version.rb
|
262
|
+
- templates/build.yml
|
262
263
|
- templates/config.erb
|
263
264
|
- templates/cover.jpg
|
264
265
|
- templates/dp-logo.png
|
@@ -298,12 +299,12 @@ require_paths:
|
|
298
299
|
- lib
|
299
300
|
required_ruby_version: !ruby/object:Gem::Requirement
|
300
301
|
requirements:
|
301
|
-
- -
|
302
|
+
- - ">="
|
302
303
|
- !ruby/object:Gem::Version
|
303
304
|
version: '0'
|
304
305
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
305
306
|
requirements:
|
306
|
-
- -
|
307
|
+
- - ">="
|
307
308
|
- !ruby/object:Gem::Version
|
308
309
|
version: '0'
|
309
310
|
requirements: []
|