summaryrefslogtreecommitdiff
path: root/spec/section_spec.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2022-04-27 04:39:14 -0600
committerDan Allen <dan.j.allen@gmail.com>2022-04-27 04:39:14 -0600
commit2e6decd6053a90d1988d8631851f554ebb276109 (patch)
tree0cfcc5c456bff207a2881dcb6de23b8134636e13 /spec/section_spec.rb
parenta0faa7b3fb608a7aa25dcdef2ad57cdc558ab17f (diff)
allow the title of any section to be hidden using the notitle option
Diffstat (limited to 'spec/section_spec.rb')
-rw-r--r--spec/section_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/section_spec.rb b/spec/section_spec.rb
index 6e28fab5..6760e870 100644
--- a/spec/section_spec.rb
+++ b/spec/section_spec.rb
@@ -713,6 +713,30 @@ describe 'Asciidoctor::PDF::Converter - Section' do
(expect appendix_text[:page_number]).to be 4
end
+ it 'should not output section title for section marked with notitle option' do
+ pdf = to_pdf <<~'EOS', analyze: true
+ = Document Title
+ :doctype: book
+
+ == Intro
+
+ Let's get started.
+
+ [%notitle]
+ == Middle
+
+ The bulk of the content.
+
+ == Conclusion
+
+ Wrapping it up.
+ EOS
+
+ middle_chapter_text = pdf.find_text page_number: 3
+ (expect middle_chapter_text).to have_size 1
+ (expect middle_chapter_text[0][:string]).to eql 'The bulk of the content.'
+ end
+
it 'should not output section title for special section marked with notitle option' do
pdf = to_pdf <<~'EOS', pdf_theme: { heading_h2_font_color: 'AA0000' }, analyze: true
= Document Title