Class: Metanorma::Plugin::Lutaml::LutamlUmlDatamodelDescriptionPreprocessor

Inherits:
Asciidoctor::Extensions::Preprocessor
  • Object
show all
Defined in:
lib/metanorma/plugin/lutaml/lutaml_uml_datamodel_description_preprocessor.rb

Overview

Macro for quick rendering of datamodel attributes/values table

@example [lutaml_uml_attributes_table,path/to/lutaml,EntityName]

Constant Summary collapse

MARCO_REGEXP =
/\[lutaml_uml_datamodel_description,([^,]+),?(.+)?\]/
LIQUID_INCLUDE_PATH =
File.join(
  Gem.loaded_specs["metanorma-plugin-lutaml"].full_gem_path,
  "lib", "metanorma", "plugin", "lutaml", "liquid_templates"
)
DEFAULT_RENDER_INCLUDE =
'packages'.freeze
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'.freeze
SUPPORTED_NESTED_MACRO =
%w[
before diagram_include_block after include_block package_text].freeze

Instance Method Summary collapse

Instance Method Details

#process(document, reader) ⇒ Object

search document for block ‘lutaml_uml_datamodel_description`

read include derectives that goes after that in block and transform
into yaml2text blocks


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

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