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, **rest) ⇒ DefinitionTerm

Returns a new instance of DefinitionTerm.



23
24
25
26
27
28
# File 'lib/coradoc/markdown/model/definition_term.rb', line 23

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