Module: Metanorma::Plugin::Lutaml::LutamlDiagramBase

Included in:
LutamlDiagramBlock, LutamlDiagramBlockMacro, LutamlEaDiagramBlockMacro, LutamlFigureInlineMacro, LutamlTableInlineMacro
Defined in:
lib/metanorma/plugin/lutaml/lutaml_diagram_base.rb

Instance Method Summary collapse

Instance Method Details

#lutaml_file(_reader) ⇒ Object



25
26
27
# File 'lib/metanorma/plugin/lutaml/lutaml_diagram_base.rb', line 25

def lutaml_file(_reader)
  raise "Implement me!"
end

#process(parent, reader, attrs) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/metanorma/plugin/lutaml/lutaml_diagram_base.rb', line 13

def process(parent, reader, attrs)
  uml_document = ::Lutaml::Lml::Parser
    .parse(lutaml_file(parent.document, reader))
  filename = generate_file(parent, reader, uml_document)
  through_attrs = generate_attrs(attrs)
  through_attrs["target"] = filename
  through_attrs["title"] = uml_document.caption
  create_image_block(parent, through_attrs)
rescue StandardError => e
  abort(parent, reader, attrs, e.message)
end