asciidoctor-epub3 1.5.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +20 -2
- data/Gemfile +7 -10
- data/README.adoc +5 -5
- data/Rakefile +1 -1
- data/asciidoctor-epub3.gemspec +18 -15
- data/bin/adb-push-ebook +17 -15
- data/data/styles/_colors.scss +90 -0
- data/data/styles/_reset.scss +54 -0
- data/data/styles/{epub3-css3-only.css → epub3-css3-only.scss} +1 -31
- data/data/styles/{epub3.css → epub3.scss} +140 -236
- data/lib/asciidoctor-epub3/converter.rb +496 -420
- data/lib/asciidoctor-epub3/ext/asciidoctor/abstract_node.rb +16 -0
- data/lib/asciidoctor-epub3/ext/asciidoctor.rb +1 -2
- data/lib/asciidoctor-epub3/ext/core/file.rb +10 -0
- data/lib/asciidoctor-epub3/ext/core/string.rb +5 -3
- data/lib/asciidoctor-epub3/ext/core.rb +1 -0
- data/lib/asciidoctor-epub3/font_icon_map.rb +1 -1
- data/lib/asciidoctor-epub3/version.rb +1 -1
- data/lib/asciidoctor-epub3.rb +1 -1
- metadata +57 -40
- data/data/styles/color-palette.css +0 -25
- data/lib/asciidoctor-epub3/ext/asciidoctor/document.rb +0 -19
- data/lib/asciidoctor-epub3/ext/asciidoctor/logging_shim.rb +0 -33
- /data/data/styles/{epub3-fonts.css → epub3-fonts.scss} +0 -0
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Asciidoctor
|
4
|
+
class AbstractNode
|
5
|
+
# See https://asciidoctor.org/docs/user-manual/#book-parts-and-chapters
|
6
|
+
# @return [Boolean]
|
7
|
+
def chapter?
|
8
|
+
return is_a?(Asciidoctor::Document) if document.doctype != 'book'
|
9
|
+
|
10
|
+
return true if context == :preamble && level.zero?
|
11
|
+
|
12
|
+
chapter_level = [document.attr('epub-chapter-level', 1).to_i, 1].max
|
13
|
+
is_a?(Asciidoctor::Section) && level <= chapter_level
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/asciidoctor-epub3.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciidoctor-epub3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Allen
|
@@ -9,28 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-01-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: asciidoctor-diagram
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: 1.5.0
|
21
|
-
- - "<"
|
18
|
+
- - "~>"
|
22
19
|
- !ruby/object:Gem::Version
|
23
|
-
version:
|
20
|
+
version: '2.0'
|
24
21
|
type: :development
|
25
22
|
prerelease: false
|
26
23
|
version_requirements: !ruby/object:Gem::Requirement
|
27
24
|
requirements:
|
28
|
-
- - "
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
version: 1.5.0
|
31
|
-
- - "<"
|
25
|
+
- - "~>"
|
32
26
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
27
|
+
version: '2.0'
|
34
28
|
- !ruby/object:Gem::Dependency
|
35
29
|
name: asciimath
|
36
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -65,28 +59,28 @@ dependencies:
|
|
65
59
|
requirements:
|
66
60
|
- - "~>"
|
67
61
|
- !ruby/object:Gem::Version
|
68
|
-
version: 2.
|
62
|
+
version: 2.4.0
|
69
63
|
type: :development
|
70
64
|
prerelease: false
|
71
65
|
version_requirements: !ruby/object:Gem::Requirement
|
72
66
|
requirements:
|
73
67
|
- - "~>"
|
74
68
|
- !ruby/object:Gem::Version
|
75
|
-
version: 2.
|
69
|
+
version: 2.4.0
|
76
70
|
- !ruby/object:Gem::Dependency
|
77
71
|
name: rake
|
78
72
|
requirement: !ruby/object:Gem::Requirement
|
79
73
|
requirements:
|
80
74
|
- - "~>"
|
81
75
|
- !ruby/object:Gem::Version
|
82
|
-
version: 13.
|
76
|
+
version: 13.1.0
|
83
77
|
type: :development
|
84
78
|
prerelease: false
|
85
79
|
version_requirements: !ruby/object:Gem::Requirement
|
86
80
|
requirements:
|
87
81
|
- - "~>"
|
88
82
|
- !ruby/object:Gem::Version
|
89
|
-
version: 13.
|
83
|
+
version: 13.1.0
|
90
84
|
- !ruby/object:Gem::Dependency
|
91
85
|
name: rouge
|
92
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -107,62 +101,70 @@ dependencies:
|
|
107
101
|
requirements:
|
108
102
|
- - "~>"
|
109
103
|
- !ruby/object:Gem::Version
|
110
|
-
version: 3.
|
104
|
+
version: 3.12.0
|
111
105
|
type: :development
|
112
106
|
prerelease: false
|
113
107
|
version_requirements: !ruby/object:Gem::Requirement
|
114
108
|
requirements:
|
115
109
|
- - "~>"
|
116
110
|
- !ruby/object:Gem::Version
|
117
|
-
version: 3.
|
111
|
+
version: 3.12.0
|
118
112
|
- !ruby/object:Gem::Dependency
|
119
113
|
name: rubocop
|
120
114
|
requirement: !ruby/object:Gem::Requirement
|
121
115
|
requirements:
|
122
116
|
- - "~>"
|
123
117
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
118
|
+
version: 1.50.2
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - "~>"
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 1.50.2
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: rubocop-rake
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - "~>"
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: 0.6.0
|
125
133
|
type: :development
|
126
134
|
prerelease: false
|
127
135
|
version_requirements: !ruby/object:Gem::Requirement
|
128
136
|
requirements:
|
129
137
|
- - "~>"
|
130
138
|
- !ruby/object:Gem::Version
|
131
|
-
version: 0.
|
139
|
+
version: 0.6.0
|
132
140
|
- !ruby/object:Gem::Dependency
|
133
141
|
name: rubocop-rspec
|
134
142
|
requirement: !ruby/object:Gem::Requirement
|
135
143
|
requirements:
|
136
144
|
- - "~>"
|
137
145
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
146
|
+
version: 2.20.0
|
139
147
|
type: :development
|
140
148
|
prerelease: false
|
141
149
|
version_requirements: !ruby/object:Gem::Requirement
|
142
150
|
requirements:
|
143
151
|
- - "~>"
|
144
152
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
153
|
+
version: 2.20.0
|
146
154
|
- !ruby/object:Gem::Dependency
|
147
155
|
name: asciidoctor
|
148
156
|
requirement: !ruby/object:Gem::Requirement
|
149
157
|
requirements:
|
150
|
-
- - "
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: 1.5.6
|
153
|
-
- - "<"
|
158
|
+
- - "~>"
|
154
159
|
- !ruby/object:Gem::Version
|
155
|
-
version:
|
160
|
+
version: '2.0'
|
156
161
|
type: :runtime
|
157
162
|
prerelease: false
|
158
163
|
version_requirements: !ruby/object:Gem::Requirement
|
159
164
|
requirements:
|
160
|
-
- - "
|
161
|
-
- !ruby/object:Gem::Version
|
162
|
-
version: 1.5.6
|
163
|
-
- - "<"
|
165
|
+
- - "~>"
|
164
166
|
- !ruby/object:Gem::Version
|
165
|
-
version:
|
167
|
+
version: '2.0'
|
166
168
|
- !ruby/object:Gem::Dependency
|
167
169
|
name: gepub
|
168
170
|
requirement: !ruby/object:Gem::Requirement
|
@@ -191,6 +193,20 @@ dependencies:
|
|
191
193
|
- - "~>"
|
192
194
|
- !ruby/object:Gem::Version
|
193
195
|
version: '3.0'
|
196
|
+
- !ruby/object:Gem::Dependency
|
197
|
+
name: sass
|
198
|
+
requirement: !ruby/object:Gem::Requirement
|
199
|
+
requirements:
|
200
|
+
- - ">="
|
201
|
+
- !ruby/object:Gem::Version
|
202
|
+
version: '0'
|
203
|
+
type: :runtime
|
204
|
+
prerelease: false
|
205
|
+
version_requirements: !ruby/object:Gem::Requirement
|
206
|
+
requirements:
|
207
|
+
- - ">="
|
208
|
+
- !ruby/object:Gem::Version
|
209
|
+
version: '0'
|
194
210
|
description: 'An extension for Asciidoctor that converts AsciiDoc documents to EPUB3
|
195
211
|
and KF8/MOBI (Kindle) e-book archives.
|
196
212
|
|
@@ -254,17 +270,18 @@ files:
|
|
254
270
|
- data/images/default-cover.svg
|
255
271
|
- data/images/default-headshot.jpg
|
256
272
|
- data/images/default-headshot.png
|
257
|
-
- data/styles/
|
258
|
-
- data/styles/
|
259
|
-
- data/styles/epub3-
|
260
|
-
- data/styles/epub3.
|
273
|
+
- data/styles/_colors.scss
|
274
|
+
- data/styles/_reset.scss
|
275
|
+
- data/styles/epub3-css3-only.scss
|
276
|
+
- data/styles/epub3-fonts.scss
|
277
|
+
- data/styles/epub3.scss
|
261
278
|
- lib/asciidoctor-epub3.rb
|
262
279
|
- lib/asciidoctor-epub3/converter.rb
|
263
280
|
- lib/asciidoctor-epub3/ext.rb
|
264
281
|
- lib/asciidoctor-epub3/ext/asciidoctor.rb
|
265
|
-
- lib/asciidoctor-epub3/ext/asciidoctor/
|
266
|
-
- lib/asciidoctor-epub3/ext/asciidoctor/logging_shim.rb
|
282
|
+
- lib/asciidoctor-epub3/ext/asciidoctor/abstract_node.rb
|
267
283
|
- lib/asciidoctor-epub3/ext/core.rb
|
284
|
+
- lib/asciidoctor-epub3/ext/core/file.rb
|
268
285
|
- lib/asciidoctor-epub3/ext/core/string.rb
|
269
286
|
- lib/asciidoctor-epub3/font_icon_map.rb
|
270
287
|
- lib/asciidoctor-epub3/version.rb
|
@@ -280,14 +297,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
280
297
|
requirements:
|
281
298
|
- - ">="
|
282
299
|
- !ruby/object:Gem::Version
|
283
|
-
version: 2.
|
300
|
+
version: 2.6.0
|
284
301
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
285
302
|
requirements:
|
286
303
|
- - ">="
|
287
304
|
- !ruby/object:Gem::Version
|
288
305
|
version: '0'
|
289
306
|
requirements: []
|
290
|
-
rubygems_version: 3.
|
307
|
+
rubygems_version: 3.5.3
|
291
308
|
signing_key:
|
292
309
|
specification_version: 4
|
293
310
|
summary: Converts AsciiDoc documents to EPUB3 and KF8/MOBI (Kindle) e-book formats
|
@@ -1,25 +0,0 @@
|
|
1
|
-
.palette-grayscale {
|
2
|
-
color: #000000; /* black :: body text, heading default */
|
3
|
-
color: #101010; /* off-black :: code, literal, blockquote text */
|
4
|
-
color: #202020; /* deep gray :: h4 */
|
5
|
-
color: #333332; /* dark gray :: h5, visited link, list bullets, abstract, caption, open quote */
|
6
|
-
color: #707070; /* medium gray :: table borders */
|
7
|
-
color: #C8C8C8; /* gray :: footer subtitle, sidebar border */
|
8
|
-
color: #E0E0E0; /* off white :: pre background, sidebar background */
|
9
|
-
color: #FFFFFF; /* white :: chapter subtitle */
|
10
|
-
}
|
11
|
-
|
12
|
-
.palette-color {
|
13
|
-
color: #468C54; /* medium green :: code annotation numbers */
|
14
|
-
color: #57AD68; /* green :: end mark, chapter title keyword */
|
15
|
-
color: #A9D8B2; /* light green */
|
16
|
-
}
|
17
|
-
|
18
|
-
/*
|
19
|
-
type scale::
|
20
|
-
50 2.27
|
21
|
-
32 1.45
|
22
|
-
30 1.36
|
23
|
-
24 1.1
|
24
|
-
22 1
|
25
|
-
*/
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class Asciidoctor::Document
|
4
|
-
class << self
|
5
|
-
def supports_syntax_highlighter?
|
6
|
-
if @supports_syntax_highlighter.nil?
|
7
|
-
# Asciidoctor only got pluggable syntax highlighters since 2.0:
|
8
|
-
# https://github.com/asciidoctor/asciidoctor/commit/23ddbaed6818025cbe74365fec7e8101f34eadca
|
9
|
-
@supports_syntax_highlighter = method_defined? :syntax_highlighter
|
10
|
-
end
|
11
|
-
|
12
|
-
@supports_syntax_highlighter
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
def syntax_highlighter
|
17
|
-
nil
|
18
|
-
end unless supports_syntax_highlighter?
|
19
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Asciidoctor
|
4
|
-
module Logging
|
5
|
-
class StubLogger
|
6
|
-
class << self
|
7
|
-
def debug message = nil
|
8
|
-
puts %(asciidoctor: DEBUG: #{message || (block_given? ? yield : '???')}) if $VERBOSE
|
9
|
-
end
|
10
|
-
|
11
|
-
def info message = nil
|
12
|
-
puts %(asciidoctor: INFO: #{message || (block_given? ? yield : '???')}) if $VERBOSE
|
13
|
-
end
|
14
|
-
|
15
|
-
def warn message = nil
|
16
|
-
::Kernel.warn %(asciidoctor: WARNING: #{message || (block_given? ? yield : '???')})
|
17
|
-
end
|
18
|
-
|
19
|
-
def error message = nil
|
20
|
-
::Kernel.warn %(asciidoctor: ERROR: #{message || (block_given? ? yield : '???')})
|
21
|
-
end
|
22
|
-
|
23
|
-
def fatal message = nil
|
24
|
-
::Kernel.warn %(asciidoctor: FATAL: #{message || (block_given? ? yield : '???')})
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def logger
|
30
|
-
StubLogger
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
File without changes
|