asciidoctor-epub3 2.1.0 → 2.1.3
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 +1 -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: e540f1e38644f36b8bc24f3fa7c4a28cfc4dc25dc48e562d896f1b5fe77b983e
|
4
|
+
data.tar.gz: 314426f63b59424041be94e51e7b6831fcf74184818b2bce4617f558b9abc08f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '04955f47c01700eb04acc9360871c1833534867a7e3f8f0358c583ec8c667fd4f2cfc71681f9f8b00087c119ca874661c6e903302fc614393a9b0ee4124cef33'
|
7
|
+
data.tar.gz: 818fe3c95a351fd42dbbfa0e13d6ad94e1ab28ffc616a5c315f61e94e1596cd0d0845ff2fbc829bcba948bcbc687369f59897211609c50de60d7a19d9b2d1117
|
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.3 (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,6 @@
|
|
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.
|
3
|
+
v2.1.3, 2024-05-12
|
4
4
|
:project-name: Asciidoctor EPUB3
|
5
5
|
:project-handle: asciidoctor-epub3
|
6
6
|
: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.3
|
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
|