Class: Coradoc::CoreModel::Callout

Inherits:
Base
  • Object
show all
Defined in:
lib/coradoc/core_model/callout.rb

Overview

A single callout annotation attached to a verbatim block.

Callouts are the AsciiDoc convention for annotating individual lines of a source/listing block: ‘<1>` markers appear inside the code and matching `<1> explanation` lines follow the block. Markdown has no native equivalent, so each format gem decides how to render them.

The CoreModel stores each annotation as a typed Callout on its parent block, with the in-code marker ‘<index>` preserved in the block’s ‘content` for verbatim round-trip.

Instance Attribute Summary collapse

Attributes inherited from Base

#element_attributes, #id, #metadata_entries, #title

Method Summary

Methods inherited from Base

#accept, #attr, #flat_text, #metadata, #semantically_equivalent?, #set_attr, #set_metadata

Instance Attribute Details

#contentString?

Returns human-readable annotation text.

Returns:

  • (String, nil)

    human-readable annotation text.



23
# File 'lib/coradoc/core_model/callout.rb', line 23

attribute :content, :string

#indexInteger?

Returns 1-based callout number matching the ‘<N>` marker embedded in the parent block’s content.

Returns:

  • (Integer, nil)

    1-based callout number matching the ‘<N>` marker embedded in the parent block’s content.



19
# File 'lib/coradoc/core_model/callout.rb', line 19

attribute :index, :integer