asciidoctor-multipage 0.0.5 → 0.0.10
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/lib/asciidoctor-multipage.rb +15 -5
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d54d7b18dc06a853c2c12062714158d3a65914b9f7aacda87ac0a939ddcc941
|
4
|
+
data.tar.gz: 9857f979f3dcf2a4dc7faed2271549c4ff473a8fb356b8747673ee828a1a35cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8cd9b2025eddf8cd9a8c54b6dc0705d60b8757dc3d360cc98247e7df2d0569d1cd464892aed4d468e3320b96e31a4fefef1ca9c135798878d571692b367e476
|
7
|
+
data.tar.gz: 99b46345a15d5e08fabe8a652644b094ef1287d34c2e32333417bbab60c4a63820d9a4f866f66087437cc8e2dae77bafc4662987f52f1083dc405b7201a8b23b
|
@@ -244,7 +244,8 @@ class MultipageHtml5Converter < Asciidoctor::Converter::Html5Converter
|
|
244
244
|
# Generate the actual HTML outline for the TOC. This method is analogous to
|
245
245
|
# Html5Converter convert_outline().
|
246
246
|
def generate_outline(node, opts = {})
|
247
|
-
|
247
|
+
# Do the same as Html5Converter convert_outline() here
|
248
|
+
return unless node.sections? && node.sections.length > 0
|
248
249
|
sectnumlevels = opts[:sectnumlevels] || (node.document.attributes['sectnumlevels'] || 3).to_i
|
249
250
|
toclevels = opts[:toclevels] || (node.document.attributes['toclevels'] || 2).to_i
|
250
251
|
sections = node.sections
|
@@ -254,7 +255,17 @@ class MultipageHtml5Converter < Asciidoctor::Converter::Html5Converter
|
|
254
255
|
if section.caption
|
255
256
|
stitle = section.captioned_title
|
256
257
|
elsif section.numbered && slevel <= sectnumlevels
|
257
|
-
|
258
|
+
if slevel < 2 && node.document.doctype == 'book'
|
259
|
+
if section.sectname == 'chapter'
|
260
|
+
stitle = %(#{(signifier = node.document.attributes['chapter-signifier']) ? "#{signifier} " : ''}#{section.sectnum} #{section.title})
|
261
|
+
elsif section.sectname == 'part'
|
262
|
+
stitle = %(#{(signifier = node.document.attributes['part-signifier']) ? "#{signifier} " : ''}#{section.sectnum nil, ':'} #{section.title})
|
263
|
+
else
|
264
|
+
stitle = %(#{section.sectnum} #{section.title})
|
265
|
+
end
|
266
|
+
else
|
267
|
+
stitle = %(#{section.sectnum} #{section.title})
|
268
|
+
end
|
258
269
|
else
|
259
270
|
stitle = section.title
|
260
271
|
end
|
@@ -349,8 +360,7 @@ class MultipageHtml5Converter < Asciidoctor::Converter::Html5Converter
|
|
349
360
|
new_document = Document.new([])
|
350
361
|
new_document.mplevel = node.mplevel
|
351
362
|
new_document.id = node.id
|
352
|
-
new_document.
|
353
|
-
new_document.set_attr('toclevels', node.attr(:toclevels))
|
363
|
+
new_document.update_attributes(node.attributes)
|
354
364
|
new_parent = new_document
|
355
365
|
node.sections.each do |section|
|
356
366
|
new_outline_doc(section, new_parent: new_parent,
|
@@ -365,7 +375,7 @@ class MultipageHtml5Converter < Asciidoctor::Converter::Html5Converter
|
|
365
375
|
numbered = node.numbered)
|
366
376
|
new_section.id = node.id
|
367
377
|
new_section.caption = node.caption
|
368
|
-
new_section.title = node.title
|
378
|
+
new_section.title = node.instance_variable_get(:@title)
|
369
379
|
new_section.mplevel = node.mplevel
|
370
380
|
new_parent << new_section
|
371
381
|
new_parent.sections.last.numeral = node.numeral
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciidoctor-multipage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Owen T. Heisler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: appraisal
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 2.2.18
|
34
34
|
type: :development
|
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:
|
40
|
+
version: 2.2.18
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: minitest
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|