Module: Metanorma::Plugin::Lutaml::LutamlEaXmiBase

Includes:
Utils
Included in:
LutamlEaDiagramBlockMacro, LutamlEaXmiPreprocessor, LutamlKlassTableBlockMacro, LutamlUmlDatamodelDescriptionPreprocessor
Defined in:
lib/metanorma/plugin/lutaml/lutaml_ea_xmi_base.rb

Constant Summary collapse

LIQUID_INCLUDE_PATH =
File.join(
  Gem.loaded_specs["metanorma-plugin-lutaml"].full_gem_path,
  "lib", "metanorma", "plugin", "lutaml", "liquid_templates"
)
DEFAULT_RENDER_INCLUDE =
"packages"
RENDER_STYLES_INCLUDES =
{
  "default" => "packages",
  "entity_list" => "packages_entity_list",
  "entity_list_class" => "packages_entity_list_class",
  "data_dictionary" => "packages_data_dictionary",
}.freeze
RENDER_STYLE_ATTRIBUTE =
"render_style"
SUPPORTED_NESTED_MACRO =
%w[
  before diagram_include_block after include_block package_text
].freeze
XMI_INDEX_REGEXP =
%r{
  ^:lutaml-xmi-index:  # Start of the pattern
  (?<index_name>.+?)   # Capture index name
  ;                    # Separator
  (?<index_path>.+?)   # Capture index path
  ;?                   # Optional separator
  (?<config_group>     # Optional config group
    \s*config=         # Config prefix
    (?<config_path>.+) # Capture config path
  )?                   # End of optional group
  $                    # End of the pattern
}x.freeze

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(document, reader) ⇒ Object

search document for block ‘lutaml_ea_xmi` or `lutaml_uml_datamodel_description` read include directives that goes after that in block and transform into yaml2text blocks



49
50
51
52
53
54
# File 'lib/metanorma/plugin/lutaml/lutaml_ea_xmi_base.rb', line 49

def process(document, reader)
  r = Asciidoctor::PreprocessorNoIfdefsReader.new document, reader.lines
  input_lines = r.readlines.to_enum
  Asciidoctor::PreprocessorNoIfdefsReader
    .new(document, processed_lines(document, input_lines))
end