Class: Metanorma::Plugin::Lutaml::LutamlEnumTableBlockMacro

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

Constant Summary collapse

DEFAULT_TEMPLATE =
File.join(
  Gem::Specification.find_by_name("metanorma-plugin-lutaml").gem_dir,
  "lib", "metanorma", "plugin", "lutaml", "liquid_templates",
  "_enum_table.liquid"
)
CONTEXT_NAME =
"enum"

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

Instance Method Details

#process(parent, target, attrs) ⇒ Object

rubocop:disable Metrics/AbcSize,Metrics/MethodLength



22
23
24
25
26
27
28
29
30
31
# File 'lib/metanorma/plugin/lutaml/lutaml_enum_table_block_macro.rb', line 22

def process(parent, target, attrs) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
  xmi_path = get_xmi_path(parent, target, attrs)
  path = get_name_path(attrs)

  enum = ::Lutaml::XMI::Parsers::XML.serialize_enumeration_by_name(
    xmi_path, path
  )

  render_table(enum, CONTEXT_NAME, parent, attrs)
end