softcover 1.7.0 → 1.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +44 -44
- data/lib/softcover/article_template/README.md +3 -3
- data/lib/softcover/article_template/html/stylesheets/softcover.css +6 -0
- data/lib/softcover/book_template/README.md +3 -3
- data/lib/softcover/book_template/html/stylesheets/softcover.css +6 -0
- data/lib/softcover/book_template/markdown_gitignore +1 -0
- data/lib/softcover/cli.rb +6 -6
- data/lib/softcover/commands/check.rb +3 -3
- data/lib/softcover/utils.rb +3 -6
- data/lib/softcover/version.rb +1 -1
- data/softcover.gemspec +3 -3
- data/spec/builders/pdf_spec.rb +1 -1
- data/spec/cli_spec.rb +14 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eafc13b9920222004e0ab0caa52d7785ed588279d7e71419274d3011aaff0b77
|
4
|
+
data.tar.gz: b2741bc597f77c9a9813224b5990e7b07317b04642fabfc3ec92d2e520149c05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3779a67d9feed14f6ddab94e6da2d646ca32cd37ed46d83a32d37660381ebae2d62a2fc3b1d90d95be2a9b83fa5dc4e0ca5f3117a09168d556169623133e8fd
|
7
|
+
data.tar.gz: 2c3e4e867f0c7f745b07e8233ae97e6351817de878c62fc896974d14c761963369a29fcd419a85a3836d4366562da1c1017c32e28f6ac4bf03e4ddcdd72fef32
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
softcover (1.7.
|
4
|
+
softcover (1.7.4)
|
5
5
|
activesupport (~> 4.2.3)
|
6
6
|
async_sinatra (~> 1.1.0)
|
7
7
|
coffee-script (>= 2.2.0)
|
@@ -12,8 +12,8 @@ PATH
|
|
12
12
|
maruku (~> 0.7.1)
|
13
13
|
msgpack (~> 1.2.0)
|
14
14
|
nokogiri (>= 1.6.0, < 2.0)
|
15
|
-
polytexnic (~> 1.
|
16
|
-
pygments.rb (~>
|
15
|
+
polytexnic (~> 1.7.1)
|
16
|
+
pygments.rb (~> 2.1)
|
17
17
|
rest-client (>= 1.8.0)
|
18
18
|
ruby-progressbar (~> 1.10)
|
19
19
|
sanitize (>= 4.6.3, < 5.3.0)
|
@@ -30,7 +30,7 @@ GEM
|
|
30
30
|
minitest (~> 5.1)
|
31
31
|
thread_safe (~> 0.3, >= 0.3.4)
|
32
32
|
tzinfo (~> 1.1)
|
33
|
-
addressable (2.
|
33
|
+
addressable (2.8.0)
|
34
34
|
public_suffix (>= 2.0.2, < 5.0)
|
35
35
|
async_sinatra (1.1.0)
|
36
36
|
rack (>= 1.4.1)
|
@@ -40,70 +40,70 @@ GEM
|
|
40
40
|
coffee-script-source
|
41
41
|
execjs
|
42
42
|
coffee-script-source (1.12.2)
|
43
|
-
concurrent-ruby (1.1.
|
43
|
+
concurrent-ruby (1.1.9)
|
44
44
|
coveralls (0.8.23)
|
45
45
|
json (>= 1.8, < 3)
|
46
46
|
simplecov (~> 0.16.1)
|
47
47
|
term-ansicolor (~> 1.3)
|
48
48
|
thor (>= 0.19.4, < 2.0)
|
49
49
|
tins (~> 1.6)
|
50
|
-
crack (0.4.
|
51
|
-
|
50
|
+
crack (0.4.5)
|
51
|
+
rexml
|
52
52
|
crass (1.0.6)
|
53
|
-
curb (0.
|
54
|
-
daemons (1.
|
55
|
-
diff-lcs (1.
|
56
|
-
docile (1.
|
53
|
+
curb (1.0.0)
|
54
|
+
daemons (1.4.1)
|
55
|
+
diff-lcs (1.5.0)
|
56
|
+
docile (1.4.0)
|
57
57
|
domain_name (0.5.20190701)
|
58
58
|
unf (>= 0.0.5, < 1.0.0)
|
59
59
|
eventmachine (1.2.7)
|
60
|
-
execjs (2.
|
61
|
-
ffi (1.
|
60
|
+
execjs (2.8.1)
|
61
|
+
ffi (1.15.5)
|
62
62
|
hashdiff (1.0.1)
|
63
63
|
http-accept (1.7.0)
|
64
|
-
http-cookie (1.0.
|
64
|
+
http-cookie (1.0.4)
|
65
65
|
domain_name (~> 0.5)
|
66
66
|
i18n (0.9.5)
|
67
67
|
concurrent-ruby (~> 1.0)
|
68
|
-
json (2.3.
|
69
|
-
kramdown (2.3.
|
68
|
+
json (2.3.1)
|
69
|
+
kramdown (2.3.1)
|
70
70
|
rexml
|
71
71
|
listen (3.2.1)
|
72
72
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
73
73
|
rb-inotify (~> 0.9, >= 0.9.10)
|
74
74
|
maruku (0.7.3)
|
75
75
|
method_source (1.0.0)
|
76
|
-
mime-types (3.
|
76
|
+
mime-types (3.4.1)
|
77
77
|
mime-types-data (~> 3.2015)
|
78
|
-
mime-types-data (3.
|
79
|
-
mini_portile2 (2.
|
80
|
-
minitest (5.
|
78
|
+
mime-types-data (3.2022.0105)
|
79
|
+
mini_portile2 (2.8.0)
|
80
|
+
minitest (5.15.0)
|
81
81
|
msgpack (1.2.10)
|
82
|
-
multi_json (1.15.0)
|
83
82
|
netrc (0.11.0)
|
84
|
-
nokogiri (1.
|
85
|
-
mini_portile2 (~> 2.
|
86
|
-
|
83
|
+
nokogiri (1.13.2)
|
84
|
+
mini_portile2 (~> 2.8.0)
|
85
|
+
racc (~> 1.4)
|
86
|
+
nokogumbo (2.0.5)
|
87
87
|
nokogiri (~> 1.8, >= 1.8.4)
|
88
|
-
polytexnic (1.
|
88
|
+
polytexnic (1.7.1)
|
89
89
|
json (~> 2.3.0)
|
90
|
-
kramdown (>=
|
90
|
+
kramdown (>= 2.0, < 3.0)
|
91
91
|
msgpack (~> 1.2.0)
|
92
|
-
nokogiri (
|
93
|
-
pygments.rb (~>
|
94
|
-
pry (0.
|
92
|
+
nokogiri (>= 1.6.0, < 2.0)
|
93
|
+
pygments.rb (~> 2.1)
|
94
|
+
pry (0.14.1)
|
95
95
|
coderay (~> 1.1)
|
96
96
|
method_source (~> 1.0)
|
97
|
-
public_suffix (4.0.
|
98
|
-
pygments.rb (
|
99
|
-
|
97
|
+
public_suffix (4.0.6)
|
98
|
+
pygments.rb (2.3.0)
|
99
|
+
racc (1.6.0)
|
100
100
|
rack (1.6.13)
|
101
101
|
rack-protection (1.5.5)
|
102
102
|
rack
|
103
103
|
rack-test (1.1.0)
|
104
104
|
rack (>= 1.0, < 3)
|
105
|
-
rake (13.0.
|
106
|
-
rb-fsevent (0.
|
105
|
+
rake (13.0.6)
|
106
|
+
rb-fsevent (0.11.1)
|
107
107
|
rb-inotify (0.10.1)
|
108
108
|
ffi (~> 1.0)
|
109
109
|
rest-client (2.1.0)
|
@@ -111,7 +111,7 @@ GEM
|
|
111
111
|
http-cookie (>= 1.0.2, < 2.0)
|
112
112
|
mime-types (>= 1.16, < 4.0)
|
113
113
|
netrc (~> 0.8)
|
114
|
-
rexml (3.2.
|
114
|
+
rexml (3.2.5)
|
115
115
|
rspec (2.14.1)
|
116
116
|
rspec-core (~> 2.14.0)
|
117
117
|
rspec-expectations (~> 2.14.0)
|
@@ -120,10 +120,10 @@ GEM
|
|
120
120
|
rspec-expectations (2.14.5)
|
121
121
|
diff-lcs (>= 1.1.3, < 2.0)
|
122
122
|
rspec-mocks (2.14.6)
|
123
|
-
ruby-prof (1.4.
|
124
|
-
ruby-progressbar (1.
|
123
|
+
ruby-prof (1.4.3)
|
124
|
+
ruby-progressbar (1.11.0)
|
125
125
|
safe_yaml (1.0.4)
|
126
|
-
sanitize (5.2.
|
126
|
+
sanitize (5.2.3)
|
127
127
|
crass (~> 1.0.2)
|
128
128
|
nokogiri (>= 1.8.0)
|
129
129
|
nokogumbo (~> 2.0)
|
@@ -145,18 +145,18 @@ GEM
|
|
145
145
|
daemons (~> 1.0, >= 1.0.9)
|
146
146
|
eventmachine (~> 1.0, >= 1.0.4)
|
147
147
|
rack (~> 1.0)
|
148
|
-
thor (1.
|
148
|
+
thor (1.2.1)
|
149
149
|
thread_safe (0.3.6)
|
150
150
|
tilt (2.0.10)
|
151
|
-
tins (1.
|
151
|
+
tins (1.31.0)
|
152
152
|
sync
|
153
|
-
tzinfo (1.2.
|
153
|
+
tzinfo (1.2.9)
|
154
154
|
thread_safe (~> 0.1)
|
155
155
|
unf (0.1.4)
|
156
156
|
unf_ext
|
157
|
-
unf_ext (0.0.
|
158
|
-
webmock (3.
|
159
|
-
addressable (>= 2.
|
157
|
+
unf_ext (0.0.8)
|
158
|
+
webmock (3.14.0)
|
159
|
+
addressable (>= 2.8.0)
|
160
160
|
crack (>= 0.3.2)
|
161
161
|
hashdiff (>= 0.4.0, < 2.0.0)
|
162
162
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# Document README (please edit)
|
2
2
|
|
3
|
-
This is the README generated by `softcover new <document>`. It's not used by the [Softcover](
|
3
|
+
This is the README generated by `softcover new <document>`. It's not used by the [Softcover](https://www.softcover.io/) website, but it's a good practice to have a README when storing your document's source at, e.g., [GitHub](https://github.com/).
|
4
4
|
|
5
|
-
Softcover documents come with a `.gitignore` file for use with [Git](
|
5
|
+
Softcover documents come with a `.gitignore` file for use with [Git](https://git-scm.com/). To get started, add your files as follows:
|
6
6
|
|
7
7
|
$ git add -A
|
8
8
|
$ git commit -m "Initialize repository"
|
9
9
|
|
10
|
-
Then follow the instructions at [GitHub](
|
10
|
+
Then follow the instructions at [GitHub](https://github.com/), [GitLab](https://gitlab.com/), or [Bitbucket](https://bitbucket.org/) to create and push a remote repository.
|
@@ -162,6 +162,12 @@ body #book {
|
|
162
162
|
margin-top: -0.4em;
|
163
163
|
}
|
164
164
|
|
165
|
+
#book .code .highlight .linenos {
|
166
|
+
color: #666;
|
167
|
+
font-weight: normal;
|
168
|
+
}
|
169
|
+
|
170
|
+
/* Include `.lineno` for backward-compatibility with Pygments 1. */
|
165
171
|
#book .code .highlight .lineno {
|
166
172
|
color: #666;
|
167
173
|
font-weight: normal;
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# Document README (please edit)
|
2
2
|
|
3
|
-
This is the README generated by `softcover new <document>`. It's not used by the [Softcover](
|
3
|
+
This is the README generated by `softcover new <document>`. It's not used by the [Softcover](https://www.softcover.io/) website, but it's a good practice to have a README when storing your document's source at, e.g., [GitHub](https://github.com/).
|
4
4
|
|
5
|
-
Softcover documents come with a `.gitignore` file for use with [Git](
|
5
|
+
Softcover documents come with a `.gitignore` file for use with [Git](https://git-scm.com/). To get started, add your files as follows:
|
6
6
|
|
7
7
|
$ git add -A
|
8
8
|
$ git commit -m "Initialize repository"
|
9
9
|
|
10
|
-
Then follow the instructions at [GitHub](
|
10
|
+
Then follow the instructions at [GitHub](https://github.com/), [GitLab](https://gitlab.com/), or [Bitbucket](https://bitbucket.org/) to create and push a remote repository.
|
@@ -162,6 +162,12 @@ body #book {
|
|
162
162
|
margin-top: -0.4em;
|
163
163
|
}
|
164
164
|
|
165
|
+
#book .code .highlight .linenos {
|
166
|
+
color: #666;
|
167
|
+
font-weight: normal;
|
168
|
+
}
|
169
|
+
|
170
|
+
/* Include `.lineno` for backward-compatibility with Pygments 1. */
|
165
171
|
#book .code .highlight .lineno {
|
166
172
|
color: #666;
|
167
173
|
font-weight: normal;
|
data/lib/softcover/cli.rb
CHANGED
@@ -33,16 +33,16 @@ module Softcover
|
|
33
33
|
desc "build:#{format}", "Build #{format.upcase}"
|
34
34
|
if format == 'pdf'
|
35
35
|
method_option :debug, aliases: '-d',
|
36
|
-
desc: "Run raw xelatex for debugging
|
36
|
+
desc: "Run raw xelatex for debugging",
|
37
37
|
type: :boolean
|
38
38
|
method_option :once, aliases: '-o',
|
39
|
-
desc: "Run
|
39
|
+
desc: "Run generator once",
|
40
40
|
type: :boolean
|
41
41
|
method_option :'find-overfull', aliases: '-f',
|
42
42
|
desc: "Find overfull hboxes",
|
43
43
|
type: :boolean
|
44
44
|
method_option :nonstop, aliases: '-n',
|
45
|
-
desc: "Run
|
45
|
+
desc: "Run generator in nonstopmode",
|
46
46
|
type: :boolean
|
47
47
|
elsif format == 'mobi'
|
48
48
|
method_option :amazon, aliases: '-a',
|
@@ -205,8 +205,8 @@ module Softcover
|
|
205
205
|
method_option :polytex,
|
206
206
|
:type => :boolean,
|
207
207
|
:default => false,
|
208
|
-
:aliases =>
|
209
|
-
:desc => "Generate a
|
208
|
+
:aliases => %w[-p --latex -l],
|
209
|
+
:desc => "Generate a LaTeX document."
|
210
210
|
method_option :article,
|
211
211
|
:type => :boolean,
|
212
212
|
:default => false,
|
@@ -267,7 +267,7 @@ module Softcover
|
|
267
267
|
# ===============================================
|
268
268
|
# Utilities
|
269
269
|
# ===============================================
|
270
|
-
desc "exercises", "Add exercise id elements as spans
|
270
|
+
desc "exercises", "Add exercise id elements as spans"
|
271
271
|
define_method "exercises" do
|
272
272
|
Softcover::Commands::Exercises.add_to_chapters!
|
273
273
|
end
|
@@ -43,7 +43,7 @@ module Softcover
|
|
43
43
|
[:java, 'Java'],
|
44
44
|
[:zip, 'zip'],
|
45
45
|
[:epubcheck, 'EpubCheck'],
|
46
|
-
[:
|
46
|
+
[:python3, 'Python 3']
|
47
47
|
]
|
48
48
|
end
|
49
49
|
|
@@ -86,8 +86,8 @@ module Softcover
|
|
86
86
|
message += " ∟ Unzip and place epubcheck-4.2.2/ in a directory on your path"
|
87
87
|
when :inkscape
|
88
88
|
message = "Inkscape (https://inkscape.org/)"
|
89
|
-
when :
|
90
|
-
message = "Configure your shell so that `
|
89
|
+
when :python3
|
90
|
+
message = "Configure your shell so that `python3` runs Python 3"
|
91
91
|
else
|
92
92
|
raise "Unknown label #{label}"
|
93
93
|
end
|
data/lib/softcover/utils.rb
CHANGED
@@ -274,12 +274,9 @@ module Softcover::Utils
|
|
274
274
|
else
|
275
275
|
""
|
276
276
|
end
|
277
|
-
when :
|
278
|
-
python = get_filename(:
|
279
|
-
|
280
|
-
require 'open3'
|
281
|
-
stdout, stderr, status = Open3.capture3("#{python} --version")
|
282
|
-
stderr.match(/Python 2/) ? python : ""
|
277
|
+
when :python3
|
278
|
+
python = get_filename(:python3)
|
279
|
+
`#{python} --version`.match(/Python 3\.*/) ? python : ""
|
283
280
|
else
|
284
281
|
get_filename(label)
|
285
282
|
end
|
data/lib/softcover/version.rb
CHANGED
data/softcover.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
|
|
10
10
|
gem.email = ["michael@softcover.io"]
|
11
11
|
gem.description = %q{Command-line interface for softcover.io}
|
12
12
|
gem.summary = %q{An ebook production system & sales and marketing platform for technical authors}
|
13
|
-
gem.homepage = "
|
13
|
+
gem.homepage = "https://github.com/softcover/softcover"
|
14
14
|
gem.license = "MIT"
|
15
15
|
|
16
16
|
gem.files = `git ls-files`.split($/)
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
19
|
gem.require_paths = ["lib"]
|
20
20
|
|
21
|
-
gem.add_dependency 'polytexnic', '~> 1.
|
21
|
+
gem.add_dependency 'polytexnic', '~> 1.7.1'
|
22
22
|
gem.add_dependency 'msgpack', '~> 1.2.0'
|
23
23
|
gem.add_dependency 'nokogiri', '>= 1.6.0', '< 2.0'
|
24
24
|
gem.add_dependency 'thor', '>= 0.18.1', '< 2.0'
|
@@ -28,7 +28,7 @@ Gem::Specification.new do |gem|
|
|
28
28
|
gem.add_dependency 'curb', '>= 0.9.7'
|
29
29
|
gem.add_dependency 'ruby-progressbar', '~> 1.10'
|
30
30
|
gem.add_dependency 'maruku', '~> 0.7.1'
|
31
|
-
gem.add_dependency 'pygments.rb', '~>
|
31
|
+
gem.add_dependency 'pygments.rb', '~> 2.1'
|
32
32
|
gem.add_dependency 'kramdown', '>= 1.6.0'
|
33
33
|
|
34
34
|
gem.add_dependency 'sinatra', '~> 1.4.4'
|
data/spec/builders/pdf_spec.rb
CHANGED
@@ -73,7 +73,7 @@ describe Softcover::Builders::Pdf do
|
|
73
73
|
|
74
74
|
context "after removing Book.txt" do
|
75
75
|
before { FileUtils.rm Softcover::BookManifest::TXT_PATH }
|
76
|
-
it "should still build the book" do
|
76
|
+
it "should still build the book (run ulimit -n 1024 if this fails)" do
|
77
77
|
expect(Softcover::BookManifest::TXT_PATH).not_to exist
|
78
78
|
expect { @builder.build! }.not_to raise_error
|
79
79
|
end
|
data/spec/cli_spec.rb
CHANGED
@@ -48,7 +48,7 @@ describe Softcover::CLI do
|
|
48
48
|
|
49
49
|
context "softcover new options" do
|
50
50
|
subject { `softcover help new` }
|
51
|
-
it { should include '-p, [--polytex]' }
|
51
|
+
it { should include '-p, --latex, -l, [--polytex]' }
|
52
52
|
it { should include '-a, [--article]' }
|
53
53
|
end
|
54
54
|
|
@@ -155,6 +155,19 @@ describe Softcover::CLI do
|
|
155
155
|
it_should_behave_like "book"
|
156
156
|
end
|
157
157
|
|
158
|
+
describe "LaTeX books" do
|
159
|
+
|
160
|
+
before(:all) do
|
161
|
+
remove_book
|
162
|
+
chdir_to_fixtures
|
163
|
+
silence { `softcover new book --latex` }
|
164
|
+
chdir_to_book
|
165
|
+
end
|
166
|
+
after(:all) { remove_book }
|
167
|
+
|
168
|
+
it_should_behave_like "book"
|
169
|
+
end
|
170
|
+
|
158
171
|
describe "Markdown books" do
|
159
172
|
|
160
173
|
before(:all) do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: softcover
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Hartl
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-02-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: polytexnic
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 1.
|
20
|
+
version: 1.7.1
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 1.
|
27
|
+
version: 1.7.1
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: msgpack
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -169,14 +169,14 @@ dependencies:
|
|
169
169
|
requirements:
|
170
170
|
- - "~>"
|
171
171
|
- !ruby/object:Gem::Version
|
172
|
-
version:
|
172
|
+
version: '2.1'
|
173
173
|
type: :runtime
|
174
174
|
prerelease: false
|
175
175
|
version_requirements: !ruby/object:Gem::Requirement
|
176
176
|
requirements:
|
177
177
|
- - "~>"
|
178
178
|
- !ruby/object:Gem::Version
|
179
|
-
version:
|
179
|
+
version: '2.1'
|
180
180
|
- !ruby/object:Gem::Dependency
|
181
181
|
name: kramdown
|
182
182
|
requirement: !ruby/object:Gem::Requirement
|
@@ -600,7 +600,7 @@ files:
|
|
600
600
|
- spec/utils_spec.rb
|
601
601
|
- spec/webmock_helpers.rb
|
602
602
|
- tasks/run_specs.rake
|
603
|
-
homepage:
|
603
|
+
homepage: https://github.com/softcover/softcover
|
604
604
|
licenses:
|
605
605
|
- MIT
|
606
606
|
metadata: {}
|
@@ -619,7 +619,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
619
619
|
- !ruby/object:Gem::Version
|
620
620
|
version: '0'
|
621
621
|
requirements: []
|
622
|
-
rubygems_version: 3.1.
|
622
|
+
rubygems_version: 3.1.6
|
623
623
|
signing_key:
|
624
624
|
specification_version: 4
|
625
625
|
summary: An ebook production system & sales and marketing platform for technical authors
|