Class: Metanorma::Plugin::Glossarist::ConceptRenderer

Inherits:
Object
  • Object
show all
Includes:
CitationHelper
Defined in:
lib/metanorma/plugin/glossarist/concept_renderer.rb

Constant Summary collapse

TERM_TYPES =
%w[preferred admitted deprecated].freeze

Instance Method Summary collapse

Methods included from CitationHelper

#citation_ref_label

Constructor Details

#initialize(concept, depth:, anchor_prefix: nil) ⇒ ConceptRenderer

Returns a new instance of ConceptRenderer.



10
11
12
13
14
# File 'lib/metanorma/plugin/glossarist/concept_renderer.rb', line 10

def initialize(concept, depth:, anchor_prefix: nil)
  @concept = concept
  @depth = depth
  @anchor_prefix = anchor_prefix
end

Instance Method Details

#renderObject



16
17
18
19
20
21
22
23
24
# File 'lib/metanorma/plugin/glossarist/concept_renderer.rb', line 16

def render
  sections = [concept_header]
  sections << alt_terms_section
  sections << definition_section
  sections << examples_section
  sections << notes_section
  sections << sources_section
  sections.compact.join("\n\n")
end