Class: Coradoc::CoreModel::Footnote

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

Overview

Represents a footnote definition in a document

Footnotes are used for auxiliary information, citations, or explanatory notes that appear at the bottom of a page or end of a document.

Examples:

Creating a simple footnote

footnote = CoreModel::Footnote.new(
  id: "fn1",
  content: "This is a footnote explanation."
)

Creating a footnote with backlink

footnote = CoreModel::Footnote.new(
  id: "cite1",
  content: "Smith, J. (2024). The Reference.",
  backlink: true
)

Instance Attribute Summary collapse

Attributes inherited from Base

#element_attributes, #metadata_entries, #title

Method Summary

Methods inherited from Base

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

Instance Attribute Details

Returns whether to include backlink to reference.

Returns:

  • (Boolean)

    whether to include backlink to reference



38
# File 'lib/coradoc/core_model/footnote.rb', line 38

attribute :backlink, :boolean, default: -> { true }

#contentString?

Returns the footnote content.

Returns:

  • (String, nil)

    the footnote content



30
# File 'lib/coradoc/core_model/footnote.rb', line 30

attribute :content, :string

#idString?

Returns the footnote identifier (e.g., “1”, “fn1”).

Returns:

  • (String, nil)

    the footnote identifier (e.g., “1”, “fn1”)



26
# File 'lib/coradoc/core_model/footnote.rb', line 26

attribute :id, :string

#inline_contentArray<String>?

Returns inline content elements.

Returns:

  • (Array<String>, nil)

    inline content elements



34
# File 'lib/coradoc/core_model/footnote.rb', line 34

attribute :inline_content, :string, collection: true