Class: Metanorma::Plugin::Lutaml::LutamlKlassTableBlockMacro
- Inherits:
-
Asciidoctor::Extensions::BlockMacroProcessor
- Object
- Asciidoctor::Extensions::BlockMacroProcessor
- Metanorma::Plugin::Lutaml::LutamlKlassTableBlockMacro
- Includes:
- LutamlEaXmiBase
- Defined in:
- lib/metanorma/plugin/lutaml/lutaml_klass_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", "_klass_table.liquid" )
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
Instance Method Summary collapse
-
#process(parent, target, attrs) ⇒ Object
rubocop:disable Metrics/AbcSize,Metrics/MethodLength.
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
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/metanorma/plugin/lutaml/lutaml_klass_table_block_macro.rb', line 19 def process(parent, target, attrs) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength xmi_path = get_xmi_path(parent, target, attrs) if attrs["template"] attrs["template"] = Utils.relative_file_path( parent.document, attrs["template"] ) end guidance = nil if attrs["guidance"] guidance = get_guidance(parent.document, attrs["guidance"]) end path = if !attrs["path"].nil? attrs["path"] elsif !attrs["package"].nil? && !attrs["name"].nil? "#{attrs['package']}::#{attrs['name']}" else attrs["name"] end klass = ::Lutaml::XMI::Parsers::XML.serialize_generalization_by_name( xmi_path, path, guidance ) render(klass, parent, attrs) end |