Class: Metanorma::Plugin::Lutaml::LutamlEaDiagramBlockMacro

Inherits:
Asciidoctor::Extensions::BlockMacroProcessor
  • Object
show all
Includes:
LutamlDiagramBase, LutamlEaXmiBase
Defined in:
lib/metanorma/plugin/lutaml/lutaml_ea_diagram_block_macro.rb

Constant Summary

Constants included from LutamlEaXmiBase

Metanorma::Plugin::Lutaml::LutamlEaXmiBase::DEFAULT_RENDER_INCLUDE, Metanorma::Plugin::Lutaml::LutamlEaXmiBase::LIQUID_INCLUDE_PATH, Metanorma::Plugin::Lutaml::LutamlEaXmiBase::RENDER_STYLES_INCLUDES, Metanorma::Plugin::Lutaml::LutamlEaXmiBase::RENDER_STYLE_ATTRIBUTE, Metanorma::Plugin::Lutaml::LutamlEaXmiBase::SUPPORTED_NESTED_MACRO, Metanorma::Plugin::Lutaml::LutamlEaXmiBase::XMI_INDEX_REGEXP

Constants included from Utils

Utils::LUTAML_EXP_IDX_TAG

Instance Method Summary collapse

Methods included from Utils

create_liquid_environment, load_express_from_folder, load_express_from_index, load_express_repo_from_cache, load_express_repo_from_path, load_express_repositories, notify_render_errors, parse_document_express_indexes, processed_lines, relative_file_path, render_liquid_string, save_express_repo_to_cache

Methods included from LutamlDiagramBase

#lutaml_file

Instance Method Details

#process(parent, _target, attrs) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/metanorma/plugin/lutaml/lutaml_ea_diagram_block_macro.rb', line 16

def process(parent, _target, attrs)
  orig_doc = get_original_document(parent, attrs["index"])
  diagram = fetch_diagram_by_name(orig_doc, attrs)
  return if diagram.nil?

  through_attrs = generate_attrs(attrs)
  through_attrs["target"] =
    img_src_path(parent.document, attrs, diagram)
  through_attrs["title"] = diagram.name

  create_image_block(parent, through_attrs)
end