Skip to content

Commit

Permalink
Merge pull request #317 from eiswind/issue/#185
Browse files Browse the repository at this point in the history
Issue #158: Use section title (with sectnums)
  • Loading branch information
obilodeau authored Jan 23, 2020
2 parents 7e53bd9 + 247a767 commit 06022fd
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 16 deletions.
24 changes: 24 additions & 0 deletions examples/level-sectnums.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// .sections
// Demonstration of section numbers and their specific reveal.js integration.
// :include: //div[@class="slides"]
// :header_footer:
= Sectnums
:backend: revealjs
:sectnums:
:sectnumlevels: 2

== First level

First content

== Vertical

Vertical slides are using level 2 sections

=== Level 2

==== Level 3 does not have sectnum, sectnumlevels is 2

== Horizontal slide

=== Also supports levels
4 changes: 2 additions & 2 deletions templates/section.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
data-state=(attr 'state'))

- unless hide_title
h2=title
h2=section_title
- (blocks - vertical_slides).each do |block|
=block.convert
- vertical_slides.each do |subsection|
Expand Down Expand Up @@ -87,5 +87,5 @@
data-state=(attr 'state'))

- unless hide_title
h2=title
h2=section_title
=content.chomp
32 changes: 32 additions & 0 deletions test/doctest/level-sectnums.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!-- .sections -->
<div class="slides">
<section class="title" data-state="title">
<h1>Sectnums</h1>
</section>
<section id="_first_level">
<h2>1. First level</h2>
<div class="paragraph">
<p>First content</p>
</div>
</section>
<section>
<section id="_vertical">
<h2>2. Vertical</h2>
<div class="paragraph">
<p>Vertical slides are using level 2 sections</p>
</div>
</section>
<section id="_level_2">
<h2>2.1. Level 2</h2>
<h3>Level 3 does not have sectnum, sectnumlevels is 2</h3>
</section>
</section>
<section>
<section id="_horizontal_slide">
<h2>3. Horizontal slide</h2>
</section>
<section id="_also_supports_levels">
<h2>3.1. Also supports levels</h2>
</section>
</section>
</div>
12 changes: 6 additions & 6 deletions test/doctest/outline.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,33 +31,33 @@ <h2>Section 2</h2>

<!-- .numbered -->
<section id="_section_1">
<h2>Section 1</h2>
<h2>1. Section 1</h2>
</section>
<section id="_unnumbered_section">
<h2>Unnumbered Section</h2>
</section>
<section>
<section id="_section_2">
<h2>Section 2</h2>
<h2>2. Section 2</h2>
</section>
<section id="_section_2_1">
<h2>Section 2.1</h2>
<h2>2.1. Section 2.1</h2>
</section>
</section>
<section id="_section_3">
<h2>Section 3</h2>
<h2>3. Section 3</h2>
</section>

<!-- .sectnumlevels -->
<section>
<section id="_section_1">
<h2>Section 1</h2>
<h2>1. Section 1</h2>
</section>
<section id="_section_1_1">
<h2>Section 1.1</h2>
<h3>Section 1.1.1</h3>
</section>
</section>
<section id="_section_2">
<h2>Section 2</h2>
<h2>2. Section 2</h2>
</section>
16 changes: 8 additions & 8 deletions test/doctest/section.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,32 +60,32 @@ <h2>Linked title with anchor</h2>

<!-- .numbered -->
<section id="_introduction_to_asciidoctor">
<h2>Introduction to Asciidoctor</h2>
<h2>1. Introduction to Asciidoctor</h2>
</section>
<section>
<section id="_quick_starts">
<h2>Quick Starts</h2>
<h2>2. Quick Starts</h2>
</section>
<section id="_usage">
<h2>Usage</h2>
<h2>2.1. Usage</h2>
<h3>Using the Command Line Interface</h3>
<h4>Processing Your Content</h4>
</section>
<section id="_syntax">
<h2>Syntax</h2>
<h2>2.2. Syntax</h2>
</section>
</section>
<section id="_terms_and_concepts">
<h2>Terms and Concepts</h2>
<h2>3. Terms and Concepts</h2>
</section>

<!-- .numbered-sectnumlevels-1 -->
<section id="_introduction_to_asciidoctor">
<h2>Introduction to Asciidoctor</h2>
<h2>1. Introduction to Asciidoctor</h2>
</section>
<section>
<section id="_quick_starts">
<h2>Quick Starts</h2>
<h2>2. Quick Starts</h2>
</section>
<section id="_usage">
<h2>Usage</h2>
Expand All @@ -96,7 +96,7 @@ <h2>Syntax</h2>
</section>
</section>
<section id="_terms_and_concepts">
<h2>Terms and Concepts</h2>
<h2>3. Terms and Concepts</h2>
</section>

<!-- .book-part-title -->
Expand Down

0 comments on commit 06022fd

Please sign in to comment.