Skip to content

Commit 45bacc3

Browse files
authored
Merge pull request #43 from CourseOrchestra/toclevels_in_contents
Toclevels in contents
2 parents c000008 + e4c50eb commit 45bacc3

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:0387aacc79b901013a1f7d79901b3259386479a7f3254859bce3e0dafd8bc845
3-
size 341760
2+
oid sha256:0a161c51e69737b969e0e671eb42c4826c797ee5c65b04a59ba3185c83ccab81
3+
size 342230

lib/slim/outline.fodt.slim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
- sectnumlevels = @document.attributes["sectnumlevels"] || 3
12
- unless sections.empty?
23
- toclevels ||= (document.attr 'toclevels', 3).to_i
34
- slevel = section_level sections.first
@@ -10,7 +11,7 @@
1011
table:table-cell table:style-name="adoc_tocce sec_title"
1112
text:p text:style-name="adoc_tocp sec_title slevel_#{slevel}"
1213
text:a xlink:type="simple" xlink:href="##{sec.id}" text:style-name="adoc_a toc_entry"
13-
|#{sec.numbered ? sec.sectnum : ""} #{sec.title}
14+
|#{(sec.numbered && slevel <= sectnumlevels) ? sec.sectnum : ""} #{sec.title}
1415
text:span text:style-name = "adoc_tociq dots_space_dots_title"
1516
="&#160;"
1617
text:span text:style-name = "adoc_tociq dots_title"

test/test_cases/stew/test.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
:doctype: book
77
:source-highlighter: rouge
88
:toc: center
9+
:toclevels: 5
910
:toc-title: Table of contents (Asciidoctor)
1011
1112

0 commit comments

Comments
 (0)