Module: Metanorma::Plugin::Lutaml::LutamlDiagramBase
- Included in:
- LutamlDiagramBlock, LutamlDiagramBlockMacro, LutamlFigureInlineMacro, LutamlTableInlineMacro
- Defined in:
- lib/metanorma/plugin/lutaml/lutaml_diagram_base.rb
Instance Method Summary collapse
Instance Method Details
#lutaml_file(reader) ⇒ Object
26 27 28 |
# File 'lib/metanorma/plugin/lutaml/lutaml_diagram_base.rb', line 26 def lutaml_file(reader) raise 'Implement me!' end |
#process(parent, reader, attrs) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/metanorma/plugin/lutaml/lutaml_diagram_base.rb', line 15 def process(parent, reader, attrs) uml_document = ::Lutaml::Uml::Parsers::Dsl.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.) end |