summaryrefslogtreecommitdiff
path: root/docs/modules/extend/examples/pdf-converter-custom-chapter-title.rb
blob: 57f5e24884f6d7a60aed2901f13c79ac3f88feb6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class PDFConverterCustomChapterTitle < (Asciidoctor::Converter.for 'pdf')
  register_for 'pdf'

  def ink_chapter_title node, title, opts = {}
    move_down cursor * 0.25
    ink_heading title, (opts.merge align: :center, text_transform: :uppercase)
    stroke_horizontal_rule 'DDDDDD', line_width: 2
    move_down theme.block_margin_bottom
    theme_font :base do
      layout_prose 'Custom text here, maybe a chapter preamble.'
    end
    start_new_page
  end
end