asciidoctor-epub3 2.1.0 → 2.1.2.dev
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +7 -0
- data/README.adoc +0 -1
- data/asciidoctor-epub3.gemspec +9 -3
- data/lib/asciidoctor-epub3/converter.rb +21 -6
- data/lib/asciidoctor-epub3/version.rb +1 -1
- metadata +15 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c0dd509a02dd2ac44d14dd78593ca9a70430a7ad851d753af2588b12758c436
|
4
|
+
data.tar.gz: f361b23eb0cd3b3ceeefa2884d8fd5a3eb2833ed53d3a5d735b4b328bc836e0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee3d61e1dfbff0cd7930477bfd88ec68c5e15afcc3c854fb003f9e75cd46ced07db5f3cdc97f052446d776782df68e36d7fcbad8f4381e2b5253ed00ae4d3715
|
7
|
+
data.tar.gz: 195f1ac17a1203f131a78ff98bde9fc1f519cf51eaff8fdc6e2af3b4417718378a37a4085481e1353e4cac2547cbbf3186052d24bbb5eabdad1bd6b859a13137
|
data/CHANGELOG.adoc
CHANGED
@@ -5,10 +5,17 @@
|
|
5
5
|
This document provides a high-level view of the changes to the {project-name} by release.
|
6
6
|
For a detailed view of what has changed, refer to the {uri-repo}/commits/master[commit history] on GitHub.
|
7
7
|
|
8
|
+
== 2.1.1 (2024-05-12) - @slonopotamus
|
9
|
+
|
10
|
+
* fix crash when section title contains inline anchor (#472)
|
11
|
+
* fix crash on an SVG image inside table cell (#470)
|
12
|
+
* lock gepub to 1.0.15 to workaround file descriptor leak (#474)
|
13
|
+
|
8
14
|
== 2.1.0 (2024-02-04) - @slonopotamus
|
9
15
|
|
10
16
|
* drop MOBI support
|
11
17
|
* add support for blocks in callouts (#463)
|
18
|
+
* stop packaging samples into gem (#462)
|
12
19
|
|
13
20
|
== 2.0.1 (2024-01-13) - @slonopotamus
|
14
21
|
|
data/README.adoc
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
= {project-name}: A _native_ EPUB3 converter for AsciiDoc
|
2
2
|
Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>
|
3
|
-
v2.1.0, 2024-02-04
|
4
3
|
:project-name: Asciidoctor EPUB3
|
5
4
|
:project-handle: asciidoctor-epub3
|
6
5
|
:uri-project: https://github.com/asciidoctor/{project-handle}
|
data/asciidoctor-epub3.gemspec
CHANGED
@@ -33,15 +33,21 @@ Gem::Specification.new do |s|
|
|
33
33
|
s.add_development_dependency 'asciimath', '~> 2.0'
|
34
34
|
s.add_development_dependency 'coderay', '~> 1.1.0'
|
35
35
|
s.add_development_dependency 'pygments.rb', '~> 2.4.0'
|
36
|
-
s.add_development_dependency 'rake', '~> 13.
|
36
|
+
s.add_development_dependency 'rake', '~> 13.2.0'
|
37
37
|
s.add_development_dependency 'rouge', '~> 3.0'
|
38
|
-
s.add_development_dependency 'rspec', '~> 3.
|
38
|
+
s.add_development_dependency 'rspec', '~> 3.13.0'
|
39
39
|
s.add_development_dependency 'rubocop', '~> 1.50.2'
|
40
40
|
s.add_development_dependency 'rubocop-rake', '~> 0.6.0'
|
41
41
|
s.add_development_dependency 'rubocop-rspec', '~> 2.20.0'
|
42
42
|
|
43
43
|
s.add_runtime_dependency 'asciidoctor', '~> 2.0'
|
44
|
-
|
44
|
+
|
45
|
+
# Temporarily ban gepub 1.0.16
|
46
|
+
# Looks like it stopped properly closing files after writing
|
47
|
+
# See https://github.com/skoji/gepub/pull/140#issuecomment-2106238457
|
48
|
+
s.add_runtime_dependency 'gepub', '>= 1.0.0', '<= 1.0.15'
|
49
|
+
# s.add_runtime_dependency 'gepub', '~> 1.0.0'
|
50
|
+
|
45
51
|
s.add_runtime_dependency 'mime-types', '~> 3.0'
|
46
52
|
|
47
53
|
# TODO: switch to 'sass-embedded' when we drop Ruby 2.5 support
|
@@ -76,6 +76,10 @@ module Asciidoctor
|
|
76
76
|
|
77
77
|
EPUB_EXTENSION_RX = /\.epub$/i.freeze
|
78
78
|
|
79
|
+
# This is a workaround for https://github.com/asciidoctor/asciidoctor/issues/4380
|
80
|
+
# Currently, there is no access to parent cell from inner document
|
81
|
+
PARENT_CELL_FIELD_NAME = :@epub3_parent_cell
|
82
|
+
|
79
83
|
QUOTE_TAGS = begin
|
80
84
|
tags = {
|
81
85
|
monospaced: ['<code>', '</code>', true],
|
@@ -95,6 +99,11 @@ module Asciidoctor
|
|
95
99
|
|
96
100
|
def initialize(backend, opts = {})
|
97
101
|
super
|
102
|
+
|
103
|
+
@xrefs_seen = Set.new
|
104
|
+
@media_files = {}
|
105
|
+
@footnotes = []
|
106
|
+
|
98
107
|
basebackend 'html'
|
99
108
|
outfilesuffix '.epub'
|
100
109
|
htmlsyntax 'xml'
|
@@ -149,9 +158,6 @@ module Asciidoctor
|
|
149
158
|
@extract = node.attr? 'ebook-extract'
|
150
159
|
@compress = node.attr 'ebook-compress'
|
151
160
|
@epubcheck_path = node.attr 'ebook-epubcheck-path'
|
152
|
-
@xrefs_seen = ::Set.new
|
153
|
-
@media_files = {}
|
154
|
-
@footnotes = []
|
155
161
|
|
156
162
|
@book = GEPUB::Book.new 'EPUB/package.opf'
|
157
163
|
@book.epub_backward_compat = true
|
@@ -794,6 +800,7 @@ document.addEventListener('DOMContentLoaded', function(event, reader) {
|
|
794
800
|
else
|
795
801
|
case cell.style
|
796
802
|
when :asciidoc
|
803
|
+
cell.inner_document.instance_variable_set(PARENT_CELL_FIELD_NAME, cell)
|
797
804
|
cell_content = %(<div class="embed">#{cell.content}</div>)
|
798
805
|
when :verse
|
799
806
|
cell_content = %(<div class="verse">#{cell.text}</div>)
|
@@ -952,7 +959,9 @@ document.addEventListener('DOMContentLoaded', function(event, reader) {
|
|
952
959
|
lines << %(<h3 class="list-heading">#{node.title}</h3>) if node.title?
|
953
960
|
lines << %(<ol#{ol_class_attr}#{ol_start_attr}#{node.option?('reversed') ? ' reversed="reversed"' : ''}>)
|
954
961
|
node.items.each do |item|
|
955
|
-
|
962
|
+
li_classes = [item.role].compact
|
963
|
+
li_class_attr = li_classes.empty? ? '' : %( class="#{li_classes * ' '}")
|
964
|
+
lines << %(<li#{li_class_attr}>
|
956
965
|
<span class="principal">#{item.text}</span>)
|
957
966
|
if item.blocks?
|
958
967
|
lines << item.content
|
@@ -979,7 +988,9 @@ document.addEventListener('DOMContentLoaded', function(event, reader) {
|
|
979
988
|
lines << %(<h3 class="list-heading">#{node.title}</h3>) if node.title?
|
980
989
|
lines << %(<ul#{ul_class_attr}>)
|
981
990
|
node.items.each do |item|
|
982
|
-
|
991
|
+
li_classes = [item.role].compact
|
992
|
+
li_class_attr = li_classes.empty? ? '' : %( class="#{li_classes * ' '}")
|
993
|
+
lines << %(<li#{li_class_attr}>
|
983
994
|
<span class="principal">#{item.text}</span>)
|
984
995
|
if item.blocks?
|
985
996
|
lines << item.content
|
@@ -1150,7 +1161,11 @@ document.addEventListener('DOMContentLoaded', function(event, reader) {
|
|
1150
1161
|
return nil if node.nil?
|
1151
1162
|
return node unless get_chapter_filename(node).nil?
|
1152
1163
|
|
1153
|
-
node = node.
|
1164
|
+
node = if node.instance_variable_defined?(PARENT_CELL_FIELD_NAME)
|
1165
|
+
node.instance_variable_get(PARENT_CELL_FIELD_NAME)
|
1166
|
+
else
|
1167
|
+
node.parent
|
1168
|
+
end
|
1154
1169
|
end
|
1155
1170
|
end
|
1156
1171
|
|
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: 2.1.
|
4
|
+
version: 2.1.2.dev
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Allen
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-05-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: asciidoctor-diagram
|
@@ -73,14 +73,14 @@ dependencies:
|
|
73
73
|
requirements:
|
74
74
|
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: 13.
|
76
|
+
version: 13.2.0
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
81
|
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: 13.
|
83
|
+
version: 13.2.0
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: rouge
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -101,14 +101,14 @@ dependencies:
|
|
101
101
|
requirements:
|
102
102
|
- - "~>"
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version: 3.
|
104
|
+
version: 3.13.0
|
105
105
|
type: :development
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
109
|
- - "~>"
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version: 3.
|
111
|
+
version: 3.13.0
|
112
112
|
- !ruby/object:Gem::Dependency
|
113
113
|
name: rubocop
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|
@@ -169,16 +169,22 @@ dependencies:
|
|
169
169
|
name: gepub
|
170
170
|
requirement: !ruby/object:Gem::Requirement
|
171
171
|
requirements:
|
172
|
-
- - "
|
172
|
+
- - ">="
|
173
173
|
- !ruby/object:Gem::Version
|
174
174
|
version: 1.0.0
|
175
|
+
- - "<="
|
176
|
+
- !ruby/object:Gem::Version
|
177
|
+
version: 1.0.15
|
175
178
|
type: :runtime
|
176
179
|
prerelease: false
|
177
180
|
version_requirements: !ruby/object:Gem::Requirement
|
178
181
|
requirements:
|
179
|
-
- - "
|
182
|
+
- - ">="
|
180
183
|
- !ruby/object:Gem::Version
|
181
184
|
version: 1.0.0
|
185
|
+
- - "<="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: 1.0.15
|
182
188
|
- !ruby/object:Gem::Dependency
|
183
189
|
name: mime-types
|
184
190
|
requirement: !ruby/object:Gem::Requirement
|
@@ -302,7 +308,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
302
308
|
- !ruby/object:Gem::Version
|
303
309
|
version: '0'
|
304
310
|
requirements: []
|
305
|
-
rubygems_version: 3.5.
|
311
|
+
rubygems_version: 3.5.9
|
306
312
|
signing_key:
|
307
313
|
specification_version: 4
|
308
314
|
summary: Converts AsciiDoc documents to EPUB3 e-book format
|