Class: Coradoc::CoreModel::AnnotationBlock

Inherits:
Block
  • Object
show all
Defined in:
lib/coradoc/core_model/annotation_block.rb

Overview

Specialized block for annotations and admonitions

Represents annotation blocks that have special semantic meaning:

  • NOTE

  • WARNING

  • CAUTION

  • IMPORTANT

  • TIP

  • Reviewer notes

  • Sidebar blocks (when used for annotations)

This class extends Block to add annotation-specific attributes that distinguish these blocks semantically from generic delimited blocks.

Examples:

Creating a NOTE annotation

note = CoreModel::AnnotationBlock.new(
  annotation_type: "note",
  delimiter_type: "****",
  content: "This is important information."
)

Creating a reviewer note

reviewer = CoreModel::AnnotationBlock.new(
  annotation_type: "reviewer",
  annotation_label: "john.doe",
  delimiter_type: "////",
  content: "Please review this section."
)

Instance Attribute Summary collapse

Attributes inherited from Block

#content, #delimiter_length, #delimiter_type, #element_type, #language, #lines

Attributes inherited from Base

#element_attributes, #id, #metadata_entries, #title

Method Summary

Methods included from ChildrenContent

#children=, #flat_text, included, #initialize, #renderable_content, #to_hash

Methods inherited from Base

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

Instance Attribute Details

#annotation_labelString?

Returns optional custom label or identifier (e.g., reviewer ID, custom note label).

Returns:

  • (String, nil)

    optional custom label or identifier (e.g., reviewer ID, custom note label)



42
# File 'lib/coradoc/core_model/annotation_block.rb', line 42

attribute :annotation_label, :string

#annotation_typeString?

Returns the type of annotation (e.g., ‘note’, ‘warning’, ‘reviewer’, ‘sidebar’).

Returns:

  • (String, nil)

    the type of annotation (e.g., ‘note’, ‘warning’, ‘reviewer’, ‘sidebar’)



37
# File 'lib/coradoc/core_model/annotation_block.rb', line 37

attribute :annotation_type, :string