Class: Coradoc::Markdown::DefinitionTerm

Inherits:
Base
  • Object
show all
Defined in:
lib/coradoc/markdown/model/definition_term.rb

Overview

DefinitionTerm model representing a term in a definition list.

A term can have multiple definitions and can span multiple lines. Terms can also have IAL attributes attached.

A term can carry a nested DefinitionList when the original document had structured sub-entries (e.g. glossary sub-terms). When ‘nested` is present, the serializer’s nested_html strategy kicks in to emit HTML ‘<dl>` structure that Markdown syntax cannot express.

Instance Method Summary collapse

Methods inherited from Base

visit, #visit

Constructor Details

#initialize(text: '', definitions: [], nested: nil, text_children: [], **rest) ⇒ DefinitionTerm

Returns a new instance of DefinitionTerm.



28
29
30
31
32
33
34
# File 'lib/coradoc/markdown/model/definition_term.rb', line 28

def initialize(text: '', definitions: [], nested: nil, text_children: [], **rest)
  super
  @text = text
  @definitions = definitions
  @nested = nested
  @text_children = Array(text_children)
end