Class: Arrolio::Flowables::NoteFlowable

Inherits:
ListFlowable show all
Defined in:
lib/arrolio/flowables/note_flowable.rb

Overview

Note / example callout: italic label in marker column, body indented. Reuses ListFlowable's hanging-indent infrastructure.

Instance Attribute Summary

Attributes inherited from ListFlowable

#body_indent, #items, #kind, #marker_width

Attributes inherited from Arrolio::Flowable

#style

Instance Method Summary collapse

Methods inherited from ListFlowable

#do_split, #emit, #height, #splittable?

Methods inherited from Arrolio::Flowable

#do_split, #emit, #height, #keep_together?, #keep_with_next?, #page_break_after?, #page_break_before?, #space_after, #space_before, #split, #splittable?

Constructor Details

#initialize(label_text, body_flowables, style: Style::Definition.new, marker_width: 22.0, body_indent: 6.0) ⇒ NoteFlowable

Returns a new instance of NoteFlowable.



8
9
10
11
12
13
14
15
16
# File 'lib/arrolio/flowables/note_flowable.rb', line 8

def initialize(label_text, body_flowables, style: Style::Definition.new,
               marker_width: 22.0, body_indent: 6.0)
  label_style = style.with(font_size: style.font_size)
  marker_run = InlineRun.new("#{label_text} ", style: label_style)
  marker_flow = TextFlowable.new([marker_run], style: label_style)
  super([[marker_flow, body_flowables]],
        kind: :note, style: style,
        marker_width: marker_width, body_indent: body_indent)
end