asciidoctor-fb2 0.2.2 → 0.4.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 +4 -4
- data/.github/dependabot.yml +5 -0
- data/.github/workflows/ci.yml +6 -9
- data/.github/workflows/release.yml +5 -10
- data/CHANGELOG.adoc +29 -1
- data/README.adoc +1 -1
- data/asciidoctor-fb2.gemspec +6 -4
- data/data/fb2.css +3 -0
- data/lib/asciidoctor_fb2.rb +79 -38
- data/lib/asciidoctor_fb2/version.rb +1 -1
- metadata +39 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2c92fc77a9c3146a344b615e53430b2a1c33c04688a60a6dd175df173ec5e173
|
|
4
|
+
data.tar.gz: 991a87e1cede4126726357252f2bb19e30380912153f1a81a511ee81873124b2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7da4ab8d23af356a2d321b9894d2747cfdf9913931566ace0b3945fb43e9dda32c76b1257e6555607cc3a47940c0e6e480213e395b60f5089120f5d6c2ad9db3
|
|
7
|
+
data.tar.gz: 49422fe74cb1ac22574d602a572abc5d79ae66883e20758ed721e7efc579771acf8359aa3acc67d8ad45400d344c8dd6421dab9cda46f04ab25ec358e2f26a0a
|
data/.github/dependabot.yml
CHANGED
data/.github/workflows/ci.yml
CHANGED
|
@@ -9,18 +9,16 @@ jobs:
|
|
|
9
9
|
- name: Set up Ruby
|
|
10
10
|
uses: ruby/setup-ruby@v1
|
|
11
11
|
with:
|
|
12
|
-
ruby-version:
|
|
13
|
-
|
|
14
|
-
run: bundle install --jobs 4 --retry 3
|
|
12
|
+
ruby-version: '3.0'
|
|
13
|
+
bundler-cache: true
|
|
15
14
|
- name: Lint
|
|
16
15
|
run: bundle exec rake lint
|
|
17
16
|
test:
|
|
18
17
|
strategy:
|
|
19
18
|
matrix:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
runs-on: ${{ matrix.platform }}
|
|
19
|
+
ruby: ['jruby', '2.4', '2.5', '2.6', '2.7', '3.0']
|
|
20
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
21
|
+
runs-on: ${{ matrix.os }}
|
|
24
22
|
steps:
|
|
25
23
|
- name: Checkout
|
|
26
24
|
uses: actions/checkout@v2
|
|
@@ -28,7 +26,6 @@ jobs:
|
|
|
28
26
|
uses: ruby/setup-ruby@v1
|
|
29
27
|
with:
|
|
30
28
|
ruby-version: ${{ matrix.ruby }}
|
|
31
|
-
|
|
32
|
-
run: bundle install --jobs 4 --retry 3
|
|
29
|
+
bundler-cache: true
|
|
33
30
|
- name: Test
|
|
34
31
|
run: bundle exec rake spec
|
|
@@ -11,14 +11,9 @@ jobs:
|
|
|
11
11
|
- name: Set up Ruby
|
|
12
12
|
uses: ruby/setup-ruby@v1
|
|
13
13
|
with:
|
|
14
|
-
ruby-version:
|
|
14
|
+
ruby-version: '3.0'
|
|
15
15
|
- name: Publish to RubyGems.org
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}\n" > $HOME/.gem/credentials
|
|
21
|
-
gem build *.gemspec
|
|
22
|
-
gem push *.gem
|
|
23
|
-
env:
|
|
24
|
-
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
|
|
16
|
+
uses: dawidd6/action-publish-gem@v1
|
|
17
|
+
with:
|
|
18
|
+
api_key: ${{ secrets.RUBYGEMS_API_KEY }}
|
|
19
|
+
|
data/CHANGELOG.adoc
CHANGED
|
@@ -1,12 +1,40 @@
|
|
|
1
1
|
= {project-name} Changelog
|
|
2
2
|
:project-name: Asciidoctor FB2
|
|
3
3
|
:project-handle: asciidoctor-fb2
|
|
4
|
-
:slug:
|
|
4
|
+
:slug: asciidoctor/{project-handle}
|
|
5
5
|
:uri-project: https://github.com/{slug}
|
|
6
6
|
|
|
7
7
|
This document provides a high-level view of the changes to the {project-name} by release.
|
|
8
8
|
For a detailed view of what has changed, refer to the {uri-project}/commits/master[commit history] on GitHub.
|
|
9
9
|
|
|
10
|
+
== 0.4.0 (2021-02-14) - @slonopotamus
|
|
11
|
+
|
|
12
|
+
* fix table cells markup
|
|
13
|
+
* bump fb2rb to 0.6.0
|
|
14
|
+
|
|
15
|
+
== 0.3.1 (2020-11-29) - @slonopotamus
|
|
16
|
+
|
|
17
|
+
* fix crash on `+toc::[]+` macro
|
|
18
|
+
* avoid adding `notes` body to FB2 if document doesn't have any footnotes
|
|
19
|
+
* fix invalid XML syntax for table cells
|
|
20
|
+
|
|
21
|
+
== 0.3.0 (2020-11-25) - @slonopotamus
|
|
22
|
+
|
|
23
|
+
* output MIME type for FB2 embedded binary files. https://github.com/slonopotamus/asciidoctor-fb2/issues/19[#19]
|
|
24
|
+
* handle `+image:file[]+` syntax for `+:front-cover-image:+` document attribute. https://github.com/slonopotamus/asciidoctor-fb2/issues/19[#19]
|
|
25
|
+
|
|
26
|
+
== 0.2.4 (2020-11-24) - @slonopotamus
|
|
27
|
+
|
|
28
|
+
* add support for table captions
|
|
29
|
+
* fix images from subfolders not loaded in Calibre
|
|
30
|
+
* add initial CSS support
|
|
31
|
+
|
|
32
|
+
== 0.2.3 (2020-11-24) - @slonopotamus
|
|
33
|
+
|
|
34
|
+
* add support for literal blocks
|
|
35
|
+
* fix crash for `menu` inline macro without submenu. https://github.com/slonopotamus/asciidoctor-fb2/issues/15[#15]
|
|
36
|
+
* add initial support for sidebar
|
|
37
|
+
|
|
10
38
|
== 0.2.2 (2020-11-24) - @slonopotamus
|
|
11
39
|
|
|
12
40
|
* do not crash on inline line break macro. https://github.com/slonopotamus/asciidoctor-fb2/issues/14[#14]
|
data/README.adoc
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Marat Radchenko <marat@slonopotamus.org>
|
|
3
3
|
:project-name: Asciidoctor FB2
|
|
4
4
|
:project-handle: asciidoctor-fb2
|
|
5
|
-
:slug:
|
|
5
|
+
:slug: asciidoctor/{project-handle}
|
|
6
6
|
:uri-project: https://github.com/{slug}
|
|
7
7
|
:uri-ci: {uri-project}/actions?query=branch%3Amaster
|
|
8
8
|
:uri-gem: https://rubygems.org/gems/{project-handle}
|
data/asciidoctor-fb2.gemspec
CHANGED
|
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
|
8
8
|
s.authors = ['Marat Radchenko']
|
|
9
9
|
s.email = ['marat@slonopotamus.org']
|
|
10
10
|
s.summary = 'Converts AsciiDoc documents to FB2 e-book formats'
|
|
11
|
-
s.homepage = 'https://github.com/
|
|
11
|
+
s.homepage = 'https://github.com/asciidoctor/asciidoctor-fb2'
|
|
12
12
|
s.license = 'MIT'
|
|
13
13
|
s.required_ruby_version = '>= 2.4.0'
|
|
14
14
|
|
|
@@ -19,11 +19,13 @@ Gem::Specification.new do |s|
|
|
|
19
19
|
s.require_paths = ['lib']
|
|
20
20
|
|
|
21
21
|
s.add_runtime_dependency 'asciidoctor', '~> 2.0'
|
|
22
|
-
s.add_runtime_dependency 'fb2rb', '~> 0.
|
|
22
|
+
s.add_runtime_dependency 'fb2rb', '~> 0.6.0'
|
|
23
|
+
s.add_runtime_dependency 'mime-types', '~> 3.0'
|
|
23
24
|
|
|
24
25
|
s.add_development_dependency 'asciidoctor-diagram', '~> 2.0'
|
|
25
26
|
s.add_development_dependency 'rake', '~> 13.0'
|
|
26
27
|
s.add_development_dependency 'rspec', '~> 3.10.0'
|
|
27
|
-
s.add_development_dependency 'rubocop', '~>
|
|
28
|
-
s.add_development_dependency 'rubocop-
|
|
28
|
+
s.add_development_dependency 'rubocop', '~> 1.9.0'
|
|
29
|
+
s.add_development_dependency 'rubocop-rake', '~> 0.5.0'
|
|
30
|
+
s.add_development_dependency 'rubocop-rspec', '~> 2.2.0'
|
|
29
31
|
end
|
data/data/fb2.css
ADDED
data/lib/asciidoctor_fb2.rb
CHANGED
|
@@ -3,14 +3,18 @@
|
|
|
3
3
|
require 'asciidoctor'
|
|
4
4
|
require 'asciidoctor/converter'
|
|
5
5
|
require 'fb2rb'
|
|
6
|
+
require 'mime/types'
|
|
6
7
|
|
|
7
8
|
module Asciidoctor
|
|
8
9
|
module FB2
|
|
10
|
+
DATA_DIR = File.expand_path(File.join(__dir__, '..', 'data'))
|
|
11
|
+
|
|
9
12
|
# Converts AsciiDoc documents to FB2 e-book formats
|
|
10
13
|
class Converter < Asciidoctor::Converter::Base # rubocop:disable Metrics/ClassLength
|
|
11
14
|
include ::Asciidoctor::Writer
|
|
12
15
|
|
|
13
16
|
CSV_DELIMITER_REGEX = /\s*,\s*/.freeze
|
|
17
|
+
IMAGE_ATTRIBUTE_VALUE_RX = /^image:{1,2}(.*?)\[(.*?)\]$/.freeze
|
|
14
18
|
|
|
15
19
|
register_for 'fb2'
|
|
16
20
|
|
|
@@ -25,6 +29,8 @@ module Asciidoctor
|
|
|
25
29
|
# @param node [Asciidoctor::Document]
|
|
26
30
|
def convert_document(node) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
|
|
27
31
|
@book = FB2rb::Book.new
|
|
32
|
+
@book.add_stylesheet('text/css', File.join(DATA_DIR, 'fb2.css'))
|
|
33
|
+
|
|
28
34
|
document_info = @book.description.document_info
|
|
29
35
|
title_info = @book.description.title_info
|
|
30
36
|
|
|
@@ -38,29 +44,28 @@ module Asciidoctor
|
|
|
38
44
|
end
|
|
39
45
|
node.authors.each do |author|
|
|
40
46
|
title_info.authors << FB2rb::Author.new(
|
|
41
|
-
author.firstname,
|
|
42
|
-
author.middlename,
|
|
43
|
-
author.lastname,
|
|
44
|
-
nil
|
|
45
|
-
[],
|
|
46
|
-
author.email.nil? ? [] : [author.email]
|
|
47
|
+
first_name: author.firstname,
|
|
48
|
+
middle_name: author.middlename,
|
|
49
|
+
last_name: author.lastname,
|
|
50
|
+
emails: author.email.nil? ? [] : [author.email]
|
|
47
51
|
)
|
|
48
52
|
end
|
|
49
53
|
|
|
50
54
|
if node.attr? 'series-name'
|
|
51
55
|
series_name = node.attr 'series-name'
|
|
52
56
|
series_volume = node.attr 'series-volume', 1
|
|
53
|
-
title_info.sequences << FB2rb::Sequence.new(series_name, series_volume)
|
|
57
|
+
title_info.sequences << FB2rb::Sequence.new(name: series_name, number: series_volume)
|
|
54
58
|
end
|
|
55
59
|
|
|
56
60
|
date = node.attr('revdate') || node.attr('docdate')
|
|
57
|
-
fb2date = FB2rb::FB2Date.new(date, Date.parse(date))
|
|
61
|
+
fb2date = FB2rb::FB2Date.new(display_value: date, value: Date.parse(date))
|
|
58
62
|
title_info.date = document_info.date = fb2date
|
|
59
63
|
|
|
60
64
|
unless (cover_image = node.attr('front-cover-image')).nil?
|
|
65
|
+
cover_image = Regexp.last_match(1) if cover_image =~ IMAGE_ATTRIBUTE_VALUE_RX
|
|
61
66
|
cover_image_path = node.image_uri(cover_image)
|
|
62
|
-
register_binary(node, cover_image_path)
|
|
63
|
-
title_info.coverpage = FB2rb::Coverpage.new([%(##{cover_image_path})])
|
|
67
|
+
register_binary(node, cover_image_path, 'image')
|
|
68
|
+
title_info.coverpage = FB2rb::Coverpage.new(images: [%(##{cover_image_path})])
|
|
64
69
|
end
|
|
65
70
|
|
|
66
71
|
document_info.id = node.attr('uuid', '')
|
|
@@ -74,8 +79,8 @@ module Asciidoctor
|
|
|
74
79
|
<title><p>#{node.doctitle}</p></title>
|
|
75
80
|
#{node.content}
|
|
76
81
|
</section>)
|
|
77
|
-
@book.bodies << FB2rb::Body.new(
|
|
78
|
-
|
|
82
|
+
@book.bodies << FB2rb::Body.new(content: body)
|
|
83
|
+
unless node.document.footnotes.empty?
|
|
79
84
|
notes = []
|
|
80
85
|
node.document.footnotes.each do |footnote|
|
|
81
86
|
notes << %(<section id="note-#{footnote.index}">
|
|
@@ -83,7 +88,7 @@ module Asciidoctor
|
|
|
83
88
|
<p>#{footnote.text}</p>
|
|
84
89
|
</section>)
|
|
85
90
|
end
|
|
86
|
-
@book.bodies << FB2rb::Body.new('notes', notes * "\n")
|
|
91
|
+
@book.bodies << FB2rb::Body.new(name: 'notes', content: notes * "\n")
|
|
87
92
|
end
|
|
88
93
|
@book
|
|
89
94
|
end
|
|
@@ -108,6 +113,11 @@ module Asciidoctor
|
|
|
108
113
|
end
|
|
109
114
|
end
|
|
110
115
|
|
|
116
|
+
# @param _node [Asciidoctor::Block]
|
|
117
|
+
def convert_toc(_node)
|
|
118
|
+
''
|
|
119
|
+
end
|
|
120
|
+
|
|
111
121
|
# @param node [Asciidoctor::Block]
|
|
112
122
|
def convert_paragraph(node)
|
|
113
123
|
lines = [
|
|
@@ -137,7 +147,7 @@ module Asciidoctor
|
|
|
137
147
|
# @param node [Asciidoctor::Block]
|
|
138
148
|
def convert_verse(node)
|
|
139
149
|
body = node.content&.split("\n\n")&.map do |stanza|
|
|
140
|
-
%(<stanza>\n<v>#{stanza.split("\n")
|
|
150
|
+
%(<stanza>\n<v>#{stanza.split("\n") * "</v>\n<v>"}</v>\n</stanza>)
|
|
141
151
|
end&.join("\n")
|
|
142
152
|
|
|
143
153
|
citetitle = node.attr('citetitle')
|
|
@@ -155,6 +165,11 @@ module Asciidoctor
|
|
|
155
165
|
|
|
156
166
|
# @param node [Asciidoctor::Block]
|
|
157
167
|
def convert_listing(node)
|
|
168
|
+
convert_literal(node)
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# @param node [Asciidoctor::Block]
|
|
172
|
+
def convert_literal(node)
|
|
158
173
|
lines = []
|
|
159
174
|
node.content.split("\n").each do |line|
|
|
160
175
|
lines << %(<p><code>#{line}</code></p>)
|
|
@@ -186,11 +201,11 @@ module Asciidoctor
|
|
|
186
201
|
caret = ' <strong>›</strong> '
|
|
187
202
|
menu = node.attr('menu')
|
|
188
203
|
menuitem = node.attr('menuitem')
|
|
189
|
-
submenus = node.attr('submenus')
|
|
204
|
+
submenus = node.attr('submenus') * %(</b>#{caret}<b>)
|
|
190
205
|
|
|
191
206
|
result = %(<strong>#{menu}</strong>)
|
|
192
|
-
result += %(#{caret}<strong>#{submenus}</strong>) unless submenus.
|
|
193
|
-
result += %(#{caret}<strong>#{menuitem}</strong>) unless menuitem.
|
|
207
|
+
result += %(#{caret}<strong>#{submenus}</strong>) unless submenus.nil_or_empty?
|
|
208
|
+
result += %(#{caret}<strong>#{menuitem}</strong>) unless menuitem.nil_or_empty?
|
|
194
209
|
|
|
195
210
|
result
|
|
196
211
|
end
|
|
@@ -207,7 +222,7 @@ module Asciidoctor
|
|
|
207
222
|
|
|
208
223
|
# @param node [Asciidoctor::Inline]
|
|
209
224
|
def convert_inline_kbd(node)
|
|
210
|
-
%(<strong>#{node.attr('keys')
|
|
225
|
+
%(<strong>#{node.attr('keys') * '</strong>+<strong>'}</strong>)
|
|
211
226
|
end
|
|
212
227
|
|
|
213
228
|
# @param node [Asciidoctor::Inline]
|
|
@@ -238,13 +253,13 @@ module Asciidoctor
|
|
|
238
253
|
|
|
239
254
|
# @param node [Asciidoctor::Inline]
|
|
240
255
|
def convert_inline_image(node)
|
|
241
|
-
image_attrs = register_binary(node, node.image_uri(node.target))
|
|
256
|
+
image_attrs = register_binary(node, node.image_uri(node.target), 'image')
|
|
242
257
|
%(<image #{image_attrs * ' '}/>)
|
|
243
258
|
end
|
|
244
259
|
|
|
245
260
|
# @param node [Asciidoctor::Block]
|
|
246
261
|
def convert_image(node)
|
|
247
|
-
image_attrs = register_binary(node, node.image_uri(node.attr('target')))
|
|
262
|
+
image_attrs = register_binary(node, node.image_uri(node.attr('target')), 'image')
|
|
248
263
|
image_attrs << %(title="#{node.captioned_title}") if node.title?
|
|
249
264
|
image_attrs << %(id="#{node.id}") if node.id
|
|
250
265
|
%(<p><image #{image_attrs * ' '}/></p>)
|
|
@@ -257,9 +272,15 @@ module Asciidoctor
|
|
|
257
272
|
doc
|
|
258
273
|
end
|
|
259
274
|
|
|
275
|
+
def determine_mime_type(filename, media_type)
|
|
276
|
+
mime_types = MIME::Types.type_for(filename)
|
|
277
|
+
mime_types.delete_if { |x| x.media_type != media_type }
|
|
278
|
+
mime_types.empty? ? nil : mime_types[0].content_type
|
|
279
|
+
end
|
|
280
|
+
|
|
260
281
|
# @param node [Asciidoctor::AbstractNode]
|
|
261
282
|
# @param target [String]
|
|
262
|
-
def register_binary(node, target) # rubocop:disable Metrics/MethodLength
|
|
283
|
+
def register_binary(node, target, media_type) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
|
263
284
|
unless Asciidoctor::Helpers.uriish?(target)
|
|
264
285
|
out_dir = node.attr('outdir', nil, true) || doc_option(node.document, :to_dir)
|
|
265
286
|
fs_path = File.join(out_dir, target)
|
|
@@ -269,7 +290,12 @@ module Asciidoctor
|
|
|
269
290
|
end
|
|
270
291
|
|
|
271
292
|
if File.readable?(fs_path)
|
|
272
|
-
|
|
293
|
+
# Calibre fails to load images if they contain path separators
|
|
294
|
+
target.sub!('/', '_')
|
|
295
|
+
target.sub!('\\', '_')
|
|
296
|
+
|
|
297
|
+
mime_type = determine_mime_type(target, media_type)
|
|
298
|
+
@book.add_binary(target, fs_path, mime_type)
|
|
273
299
|
target = %(##{target})
|
|
274
300
|
end
|
|
275
301
|
end
|
|
@@ -287,6 +313,13 @@ module Asciidoctor
|
|
|
287
313
|
lines * "\n"
|
|
288
314
|
end
|
|
289
315
|
|
|
316
|
+
# @param node [Asciidoctor::Block]
|
|
317
|
+
def convert_sidebar(node)
|
|
318
|
+
title_tag = node.title.nil_or_empty? ? '' : %(<p><strong>#{node.title}</strong></p>)
|
|
319
|
+
%(#{title_tag}
|
|
320
|
+
#{node.content})
|
|
321
|
+
end
|
|
322
|
+
|
|
290
323
|
# @param node [Asciidoctor::List]
|
|
291
324
|
def convert_ulist(node)
|
|
292
325
|
lines = []
|
|
@@ -347,28 +380,36 @@ module Asciidoctor
|
|
|
347
380
|
lines * "\n"
|
|
348
381
|
end
|
|
349
382
|
|
|
383
|
+
# @param cell [Asciidoctor::Table::Cell]
|
|
384
|
+
def get_cell_content(cell) # rubocop:disable Metrics/MethodLength
|
|
385
|
+
case cell.style
|
|
386
|
+
when :asciidoc
|
|
387
|
+
cell.content
|
|
388
|
+
when :emphasis
|
|
389
|
+
%(<emphasis>#{cell.text}</emphasis>)
|
|
390
|
+
when :literal
|
|
391
|
+
%(<code>#{cell.text}</code>)
|
|
392
|
+
when :monospaced
|
|
393
|
+
%(<code>#{cell.text}</code>)
|
|
394
|
+
when :strong
|
|
395
|
+
%(<strong>#{cell.text}</strong>)
|
|
396
|
+
else
|
|
397
|
+
cell.text
|
|
398
|
+
end
|
|
399
|
+
end
|
|
400
|
+
|
|
350
401
|
# @param node [Asciidoctor::Table]
|
|
351
402
|
def convert_table(node) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
|
|
352
|
-
lines = [
|
|
353
|
-
node.
|
|
403
|
+
lines = []
|
|
404
|
+
lines << %(<subtitle>#{node.captioned_title}</subtitle>) if node.title?
|
|
405
|
+
lines << '<table>'
|
|
406
|
+
node.rows.to_h.each do |tsec, rows|
|
|
354
407
|
next if rows.empty?
|
|
355
408
|
|
|
356
409
|
rows.each do |row|
|
|
357
410
|
lines << '<tr>'
|
|
358
411
|
row.each do |cell|
|
|
359
|
-
cell_content =
|
|
360
|
-
cell.text
|
|
361
|
-
else
|
|
362
|
-
case cell.style
|
|
363
|
-
when :asciidoc
|
|
364
|
-
cell.content
|
|
365
|
-
when :literal
|
|
366
|
-
%(<p><pre>#{cell.text}</pre></p>)
|
|
367
|
-
else
|
|
368
|
-
(cell_content = cell.content).empty? ? '' : %(<p>#{cell_content.join "</p>\n<p>"}</p>)
|
|
369
|
-
end
|
|
370
|
-
end
|
|
371
|
-
|
|
412
|
+
cell_content = get_cell_content(cell)
|
|
372
413
|
cell_tag_name = (tsec == :head || cell.style == :header ? 'th' : 'td')
|
|
373
414
|
cell_attrs = [
|
|
374
415
|
%(halign="#{cell.attr 'halign'}"),
|
|
@@ -376,7 +417,7 @@ module Asciidoctor
|
|
|
376
417
|
]
|
|
377
418
|
cell_attrs << %(colspan="#{cell.colspan}") if cell.colspan
|
|
378
419
|
cell_attrs << %(rowspan="#{cell.rowspan}") if cell.rowspan
|
|
379
|
-
lines << %(<#{cell_tag_name} #{cell_attrs * ' '}
|
|
420
|
+
lines << %(<#{cell_tag_name} #{cell_attrs * ' '}>#{cell_content}</#{cell_tag_name}>)
|
|
380
421
|
end
|
|
381
422
|
lines << '</tr>'
|
|
382
423
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: asciidoctor-fb2
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Marat Radchenko
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-02-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: asciidoctor
|
|
@@ -30,14 +30,28 @@ dependencies:
|
|
|
30
30
|
requirements:
|
|
31
31
|
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: 0.
|
|
33
|
+
version: 0.6.0
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
38
|
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: 0.
|
|
40
|
+
version: 0.6.0
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: mime-types
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '3.0'
|
|
48
|
+
type: :runtime
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '3.0'
|
|
41
55
|
- !ruby/object:Gem::Dependency
|
|
42
56
|
name: asciidoctor-diagram
|
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -86,28 +100,42 @@ dependencies:
|
|
|
86
100
|
requirements:
|
|
87
101
|
- - "~>"
|
|
88
102
|
- !ruby/object:Gem::Version
|
|
89
|
-
version:
|
|
103
|
+
version: 1.9.0
|
|
104
|
+
type: :development
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - "~>"
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: 1.9.0
|
|
111
|
+
- !ruby/object:Gem::Dependency
|
|
112
|
+
name: rubocop-rake
|
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
|
114
|
+
requirements:
|
|
115
|
+
- - "~>"
|
|
116
|
+
- !ruby/object:Gem::Version
|
|
117
|
+
version: 0.5.0
|
|
90
118
|
type: :development
|
|
91
119
|
prerelease: false
|
|
92
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
121
|
requirements:
|
|
94
122
|
- - "~>"
|
|
95
123
|
- !ruby/object:Gem::Version
|
|
96
|
-
version: 0.
|
|
124
|
+
version: 0.5.0
|
|
97
125
|
- !ruby/object:Gem::Dependency
|
|
98
126
|
name: rubocop-rspec
|
|
99
127
|
requirement: !ruby/object:Gem::Requirement
|
|
100
128
|
requirements:
|
|
101
129
|
- - "~>"
|
|
102
130
|
- !ruby/object:Gem::Version
|
|
103
|
-
version:
|
|
131
|
+
version: 2.2.0
|
|
104
132
|
type: :development
|
|
105
133
|
prerelease: false
|
|
106
134
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
135
|
requirements:
|
|
108
136
|
- - "~>"
|
|
109
137
|
- !ruby/object:Gem::Version
|
|
110
|
-
version:
|
|
138
|
+
version: 2.2.0
|
|
111
139
|
description:
|
|
112
140
|
email:
|
|
113
141
|
- marat@slonopotamus.org
|
|
@@ -129,6 +157,7 @@ files:
|
|
|
129
157
|
- Rakefile
|
|
130
158
|
- asciidoctor-fb2.gemspec
|
|
131
159
|
- bin/asciidoctor-fb2
|
|
160
|
+
- data/fb2.css
|
|
132
161
|
- lib/asciidoctor_fb2.rb
|
|
133
162
|
- lib/asciidoctor_fb2/version.rb
|
|
134
163
|
- tasks/bundler.rake
|
|
@@ -136,7 +165,7 @@ files:
|
|
|
136
165
|
- tasks/console.rake
|
|
137
166
|
- tasks/rspec.rake
|
|
138
167
|
- tasks/rubocop.rake
|
|
139
|
-
homepage: https://github.com/
|
|
168
|
+
homepage: https://github.com/asciidoctor/asciidoctor-fb2
|
|
140
169
|
licenses:
|
|
141
170
|
- MIT
|
|
142
171
|
metadata: {}
|
|
@@ -155,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
155
184
|
- !ruby/object:Gem::Version
|
|
156
185
|
version: '0'
|
|
157
186
|
requirements: []
|
|
158
|
-
rubygems_version: 3.
|
|
187
|
+
rubygems_version: 3.2.3
|
|
159
188
|
signing_key:
|
|
160
189
|
specification_version: 4
|
|
161
190
|
summary: Converts AsciiDoc documents to FB2 e-book formats
|