Skip to content

Commit

Permalink
WiP: Fixing owenh000#15
Browse files Browse the repository at this point in the history
  • Loading branch information
veselov committed Jun 29, 2021
1 parent 6cd8bb2 commit 0adf401
Show file tree
Hide file tree
Showing 21 changed files with 104 additions and 135 deletions.
4 changes: 2 additions & 2 deletions lib/asciidoctor-multipage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def convert_document(node)
generate_nav_links(node)

# Create and save a skeleton document for generating the TOC lists.
@@full_outline = new_outline_doc(node)
@@full_outline = new_outline_doc(node) unless defined?(@@full_outline)
# Save the document catalog to use for each part/chapter page.
@catalog = node.catalog

Expand All @@ -179,7 +179,7 @@ def convert_document(node)
part = block
part.convert
text = %(<<#{part.id},#{part.captioned_title}>>)
if desc = block.attr('desc') then text << %( – #{desc}) end
if (desc = block.attr('desc')) then text << %( – #{desc}) end
parts_list << Asciidoctor::ListItem.new(parts_list, text)
end
end
Expand Down
16 changes: 3 additions & 13 deletions test/black-box-docs/basic-multipart/_chapter_1.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
<div id="toc" class="toc">
<div id="toctitle">Table of Contents</div>
<p><span class="toc-root"><a href="basic-multipart.html">Basic Multipart Test</a></span></p><ul class="sectlevel0">
<li><a href="_part_1.html">Part 1</a>
<ul class="sectlevel1">
<li><a href="_chapter_1.html"><span class="toc-current">Chapter 1</span></a>
<p><span class="toc-root"><a href="basic-multipart.html">Basic Multipart Test</a></span></p><ul class="sectlevel1">
<li><a href="_second.html">SECOND</a>
<ul class="sectlevel2">
<li><a href="_chapter_1.html#_section_1_1">Section 1-1</a>
</li>
<li><a href="_chapter_1.html#_section_1_2">Section 1-2</a>
<li><a href="_oops.html">OOPS</a>
</li>
</ul>
</li>
<li><a href="_chapter_2.html">Chapter 2</a>
</li>
</ul>
</li>
<li><a href="_part_2.html">Part 2</a>
</li>
</ul>
</div>
<div class="sect1">
Expand Down
16 changes: 3 additions & 13 deletions test/black-box-docs/basic-multipart/_chapter_2.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
<div id="toc" class="toc">
<div id="toctitle">Table of Contents</div>
<p><span class="toc-root"><a href="basic-multipart.html">Basic Multipart Test</a></span></p><ul class="sectlevel0">
<li><a href="_part_1.html">Part 1</a>
<ul class="sectlevel1">
<li><a href="_chapter_1.html">Chapter 1</a>
</li>
<li><a href="_chapter_2.html"><span class="toc-current">Chapter 2</span></a>
<p><span class="toc-root"><a href="basic-multipart.html">Basic Multipart Test</a></span></p><ul class="sectlevel1">
<li><a href="_second.html">SECOND</a>
<ul class="sectlevel2">
<li><a href="_chapter_2.html#_section_2_1">Section 2-1</a>
</li>
<li><a href="_chapter_2.html#_section_2_2">Section 2-2</a>
<li><a href="_oops.html">OOPS</a>
</li>
</ul>
</li>
</ul>
</li>
<li><a href="_part_2.html">Part 2</a>
</li>
</ul>
</div>
<div class="sect1">
<h2 id="_chapter_2">Chapter 2</h2>
Expand Down
16 changes: 3 additions & 13 deletions test/black-box-docs/basic-multipart/_chapter_3.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
<div id="toc" class="toc">
<div id="toctitle">Table of Contents</div>
<p><span class="toc-root"><a href="basic-multipart.html">Basic Multipart Test</a></span></p><ul class="sectlevel0">
<li><a href="_part_1.html">Part 1</a>
</li>
<li><a href="_part_2.html">Part 2</a>
<ul class="sectlevel1">
<li><a href="_chapter_3.html"><span class="toc-current">Chapter 3</span></a>
<p><span class="toc-root"><a href="basic-multipart.html">Basic Multipart Test</a></span></p><ul class="sectlevel1">
<li><a href="_second.html">SECOND</a>
<ul class="sectlevel2">
<li><a href="_chapter_3.html#_section_3_1">Section 3-1</a>
</li>
<li><a href="_chapter_3.html#_section_3_2">Section 3-2</a>
</li>
</ul>
</li>
<li><a href="_chapter_4.html">Chapter 4</a>
<li><a href="_oops.html">OOPS</a>
</li>
</ul>
</li>
Expand Down
16 changes: 3 additions & 13 deletions test/black-box-docs/basic-multipart/_chapter_4.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
<div id="toc" class="toc">
<div id="toctitle">Table of Contents</div>
<p><span class="toc-root"><a href="basic-multipart.html">Basic Multipart Test</a></span></p><ul class="sectlevel0">
<li><a href="_part_1.html">Part 1</a>
</li>
<li><a href="_part_2.html">Part 2</a>
<ul class="sectlevel1">
<li><a href="_chapter_3.html">Chapter 3</a>
</li>
<li><a href="_chapter_4.html"><span class="toc-current">Chapter 4</span></a>
<p><span class="toc-root"><a href="basic-multipart.html">Basic Multipart Test</a></span></p><ul class="sectlevel1">
<li><a href="_second.html">SECOND</a>
<ul class="sectlevel2">
<li><a href="_chapter_4.html#_section_4_1">Section 4-1</a>
</li>
<li><a href="_chapter_4.html#_section_4_2">Section 4-2</a>
</li>
</ul>
<li><a href="_oops.html">OOPS</a>
</li>
</ul>
</li>
Expand Down
12 changes: 4 additions & 8 deletions test/black-box-docs/basic-multipart/_part_1.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
<div id="toc" class="toc">
<div id="toctitle">Table of Contents</div>
<p><span class="toc-root"><a href="basic-multipart.html">Basic Multipart Test</a></span></p><ul class="sectlevel0">
<li><a href="_part_1.html"><span class="toc-current">Part 1</span></a>
<ul class="sectlevel1">
<li><a href="_chapter_1.html">Chapter 1</a>
</li>
<li><a href="_chapter_2.html">Chapter 2</a>
<p><span class="toc-root"><a href="basic-multipart.html">Basic Multipart Test</a></span></p><ul class="sectlevel1">
<li><a href="_second.html">SECOND</a>
<ul class="sectlevel2">
<li><a href="_oops.html">OOPS</a>
</li>
</ul>
</li>
<li><a href="_part_2.html">Part 2</a>
</li>
</ul>
</div>
<h1 id="_part_1" class="sect0">Part 1</h1>
Expand Down
12 changes: 4 additions & 8 deletions test/black-box-docs/basic-multipart/_part_2.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
<div id="toc" class="toc">
<div id="toctitle">Table of Contents</div>
<p><span class="toc-root"><a href="basic-multipart.html">Basic Multipart Test</a></span></p><ul class="sectlevel0">
<li><a href="_part_1.html">Part 1</a>
</li>
<li><a href="_part_2.html"><span class="toc-current">Part 2</span></a>
<ul class="sectlevel1">
<li><a href="_chapter_3.html">Chapter 3</a>
</li>
<li><a href="_chapter_4.html">Chapter 4</a>
<p><span class="toc-root"><a href="basic-multipart.html">Basic Multipart Test</a></span></p><ul class="sectlevel1">
<li><a href="_second.html">SECOND</a>
<ul class="sectlevel2">
<li><a href="_oops.html">OOPS</a>
</li>
</ul>
</li>
Expand Down
8 changes: 5 additions & 3 deletions test/black-box-docs/basic-multipart/basic-multipart.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<div id="toc" class="toc">
<div id="toctitle">Table of Contents</div>
<p><span class="toc-root toc-current"><a href="basic-multipart.html">Basic Multipart Test</a></span></p><ul class="sectlevel0">
<li><a href="_part_1.html">Part 1</a>
<p><span class="toc-root toc-current"><a href="basic-multipart.html">Basic Multipart Test</a></span></p><ul class="sectlevel1">
<li><a href="_second.html">SECOND</a>
<ul class="sectlevel2">
<li><a href="_oops.html">OOPS</a>
</li>
<li><a href="_part_2.html">Part 2</a>
</ul>
</li>
</ul>
</div>
Expand Down
8 changes: 2 additions & 6 deletions test/black-box-docs/basic/_chapter_1.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
<div id="toc" class="toc">
<div id="toctitle">Table of Contents</div>
<p><span class="toc-root"><a href="basic.html">Basic Test</a></span></p><ul class="sectlevel1">
<li><a href="_chapter_1.html"><span class="toc-current">Chapter 1</span></a>
<li><a href="_second.html">SECOND</a>
<ul class="sectlevel2">
<li><a href="_chapter_1.html#_section_1_1">Section 1-1</a>
</li>
<li><a href="_chapter_1.html#_section_1_2">Section 1-2</a>
<li><a href="_oops.html">OOPS</a>
</li>
</ul>
</li>
<li><a href="_chapter_2.html">Chapter 2</a>
</li>
</ul>
</div>
<div class="sect1">
Expand Down
8 changes: 2 additions & 6 deletions test/black-box-docs/basic/_chapter_2.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
<div id="toc" class="toc">
<div id="toctitle">Table of Contents</div>
<p><span class="toc-root"><a href="basic.html">Basic Test</a></span></p><ul class="sectlevel1">
<li><a href="_chapter_1.html">Chapter 1</a>
</li>
<li><a href="_chapter_2.html"><span class="toc-current">Chapter 2</span></a>
<li><a href="_second.html">SECOND</a>
<ul class="sectlevel2">
<li><a href="_chapter_2.html#_section_2_1">Section 2-1</a>
</li>
<li><a href="_chapter_2.html#_section_2_2">Section 2-2</a>
<li><a href="_oops.html">OOPS</a>
</li>
</ul>
</li>
Expand Down
6 changes: 4 additions & 2 deletions test/black-box-docs/basic/basic.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<div id="toc" class="toc">
<div id="toctitle">Table of Contents</div>
<p><span class="toc-root toc-current"><a href="basic.html">Basic Test</a></span></p><ul class="sectlevel1">
<li><a href="_chapter_1.html">Chapter 1</a>
<li><a href="_second.html">SECOND</a>
<ul class="sectlevel2">
<li><a href="_oops.html">OOPS</a>
</li>
<li><a href="_chapter_2.html">Chapter 2</a>
</ul>
</li>
</ul>
</div>
Expand Down
31 changes: 31 additions & 0 deletions test/black-box-docs/consistent-toc/consistent-toc.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
= TOP
:toc:
:multipage-level: 2

== Domain 1

=== Document 1

Lorem Ipsum is simply dummy text of the printing and typesetting industry.

=== Document 2

It is a long established fact that a reader will be distracted by the
readable content of a page when looking at its layout.

[cols=","]
|===
|good doc a|
* bad doc
|===

== Domain 2

=== Document 1

Contrary to popular belief, Lorem Ipsum is not simply random text.

=== Document 2

There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form,
by injected humour, or randomised words which don't look even slightly believable.
6 changes: 2 additions & 4 deletions test/black-box-docs/other/chapter1.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<div id="toc" class="toc">
<div id="toctitle">Table of Contents</div>
<p><span class="toc-root"><a href="other.html">Other Tests</a></span></p><ul class="sectlevel1">
<li><a href="chapter1.html"><span class="toc-current">1. First Chapter</span></a>
<li><a href="_second.html">SECOND</a>
<ul class="sectlevel2">
<li><a href="chapter1.html#myattr">1.1. Custom Attribute</a>
</li>
<li><a href="chapter1.html#role">1.2. <span class="role">With Role</span></a>
<li><a href="_oops.html">OOPS</a>
</li>
</ul>
</li>
Expand Down
6 changes: 5 additions & 1 deletion test/black-box-docs/other/other.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<div id="toc" class="toc">
<div id="toctitle">Table of Contents</div>
<p><span class="toc-root toc-current"><a href="other.html">Other Tests</a></span></p><ul class="sectlevel1">
<li><a href="chapter1.html">1. First Chapter</a>
<li><a href="_second.html">SECOND</a>
<ul class="sectlevel2">
<li><a href="_oops.html">OOPS</a>
</li>
</ul>
</li>
</ul>
</div>
Expand Down
12 changes: 4 additions & 8 deletions test/black-box-docs/sample/about-sample.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
<div id="toc" class="toc">
<div id="toctitle">Table of Contents</div>
<p><span class="toc-root"><a href="sample.html">MultipageHtml5Converter Sample</a></span></p><ul class="sectlevel0">
<li><a href="about-sample.html"><span class="toc-current">About This Sample</span></a>
<ul class="sectlevel1">
<li><a href="about-sample.html#tree">1. Tree Nodes</a>
</li>
<li><a href="about-sample.html#output">2. Output Files</a>
<p><span class="toc-root"><a href="sample.html">MultipageHtml5Converter Sample</a></span></p><ul class="sectlevel1">
<li><a href="_second.html">SECOND</a>
<ul class="sectlevel2">
<li><a href="_oops.html">OOPS</a>
</li>
</ul>
</li>
<li><a href="custom-level.html">Custom Level Part</a>
</li>
</ul>
</div>
<h1 id="about-sample" class="sect0">About This Sample</h1>
Expand Down
14 changes: 3 additions & 11 deletions test/black-box-docs/sample/custom-chapter-1.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
<div id="toc" class="toc">
<div id="toctitle">Table of Contents</div>
<p><span class="toc-root"><a href="sample.html">MultipageHtml5Converter Sample</a></span></p><ul class="sectlevel0">
<li><a href="about-sample.html">About This Sample</a>
</li>
<li><a href="custom-level.html">Custom Level Part</a>
<ul class="sectlevel1">
<li><a href="custom-chapter-1.html"><span class="toc-current">3. One Chapter</span></a>
<p><span class="toc-root"><a href="sample.html">MultipageHtml5Converter Sample</a></span></p><ul class="sectlevel1">
<li><a href="_second.html">SECOND</a>
<ul class="sectlevel2">
<li><a href="custom-chapter-1.html#xrefs1">3.1. Cross-References</a>
</li>
</ul>
</li>
<li><a href="custom-chapter-2.html">4. Another Chapter</a>
<li><a href="_oops.html">OOPS</a>
</li>
</ul>
</li>
Expand Down
14 changes: 3 additions & 11 deletions test/black-box-docs/sample/custom-chapter-2.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
<div id="toc" class="toc">
<div id="toctitle">Table of Contents</div>
<p><span class="toc-root"><a href="sample.html">MultipageHtml5Converter Sample</a></span></p><ul class="sectlevel0">
<li><a href="about-sample.html">About This Sample</a>
</li>
<li><a href="custom-level.html">Custom Level Part</a>
<ul class="sectlevel1">
<li><a href="custom-chapter-1.html">3. One Chapter</a>
</li>
<li><a href="custom-chapter-2.html"><span class="toc-current">4. Another Chapter</span></a>
<p><span class="toc-root"><a href="sample.html">MultipageHtml5Converter Sample</a></span></p><ul class="sectlevel1">
<li><a href="_second.html">SECOND</a>
<ul class="sectlevel2">
<li><a href="custom-chapter-2.html#xrefs2">4.1. More Cross-References</a>
</li>
</ul>
<li><a href="_oops.html">OOPS</a>
</li>
</ul>
</li>
Expand Down
12 changes: 4 additions & 8 deletions test/black-box-docs/sample/custom-level.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
<div id="toc" class="toc">
<div id="toctitle">Table of Contents</div>
<p><span class="toc-root"><a href="sample.html">MultipageHtml5Converter Sample</a></span></p><ul class="sectlevel0">
<li><a href="about-sample.html">About This Sample</a>
</li>
<li><a href="custom-level.html"><span class="toc-current">Custom Level Part</span></a>
<ul class="sectlevel1">
<li><a href="custom-chapter-1.html">3. One Chapter</a>
</li>
<li><a href="custom-chapter-2.html">4. Another Chapter</a>
<p><span class="toc-root"><a href="sample.html">MultipageHtml5Converter Sample</a></span></p><ul class="sectlevel1">
<li><a href="_second.html">SECOND</a>
<ul class="sectlevel2">
<li><a href="_oops.html">OOPS</a>
</li>
</ul>
</li>
Expand Down
8 changes: 5 additions & 3 deletions test/black-box-docs/sample/sample.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<div id="toc" class="toc">
<div id="toctitle">Table of Contents</div>
<p><span class="toc-root toc-current"><a href="sample.html">MultipageHtml5Converter Sample</a></span></p><ul class="sectlevel0">
<li><a href="about-sample.html">About This Sample</a>
<p><span class="toc-root toc-current"><a href="sample.html">MultipageHtml5Converter Sample</a></span></p><ul class="sectlevel1">
<li><a href="_second.html">SECOND</a>
<ul class="sectlevel2">
<li><a href="_oops.html">OOPS</a>
</li>
<li><a href="custom-level.html">Custom Level Part</a>
</ul>
</li>
</ul>
</div>
Expand Down
9 changes: 8 additions & 1 deletion test/black-box-docs/table-block-operator/_second.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<div id="toc" class="toc">
<div id="toctitle">Table of Contents</div>
<p><span class="toc-root"><a href="table-block-operator.html">TOP</a></span></p>
<p><span class="toc-root"><a href="table-block-operator.html">TOP</a></span></p><ul class="sectlevel1">
<li><a href="_second.html"><span class="toc-current">SECOND</span></a>
<ul class="sectlevel2">
<li><a href="_oops.html">OOPS</a>
</li>
</ul>
</li>
</ul>
</div>
<div class="sect1">
<h2 id="_second">SECOND</h2>
Expand Down
Loading

0 comments on commit 0adf401

Please sign in to comment.