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

Included in:
LutamlEaDiagramBlockMacro, LutamlEaXmiPreprocessor, 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 =

rubocop:disable Lint/MixedRegexpCaptureTypes,Layout/LineLength

/^:lutaml-xmi-index:(?<index_name>.+?);(?<index_path>.+?);?(\s*config=(?<config_path>.+))?$/.freeze

Instance Method Summary collapse

Instance Method Details

#process(document, reader) ⇒ Object

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



36
37
38
39
40
41
# File 'lib/metanorma/plugin/lutaml/lutaml_ea_xmi_base.rb', line 36

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