Class: Metanorma::Plugin::Lutaml::LutamlUmlClassPreprocessor
- Inherits:
-
Asciidoctor::Extensions::Preprocessor
- Object
- Asciidoctor::Extensions::Preprocessor
- Metanorma::Plugin::Lutaml::LutamlUmlClassPreprocessor
- Defined in:
- lib/metanorma/plugin/lutaml/lutaml_uml_class_preprocessor.rb
Overview
Macro for quick rendering of datamodel attributes/values table
@example [lutaml_uml_class,path/to/lutaml,EntityName]
Direct Known Subclasses
Constant Summary collapse
- MACRO_REGEXP =
/\[lutaml_uml_class,([^,]+),?([^,]+),?(.+?)?\]/
Instance Method Summary collapse
- #get_macro_regexp ⇒ Object
-
#process(document, reader) ⇒ Object
search document for block ‘datamodel_attributes_table` read include derectives that goes after that in block and transform into yaml2text blocks.
Instance Method Details
#get_macro_regexp ⇒ Object
19 20 21 |
# File 'lib/metanorma/plugin/lutaml/lutaml_uml_class_preprocessor.rb', line 19 def get_macro_regexp self.class.const_get(:MACRO_REGEXP) end |
#process(document, reader) ⇒ Object
search document for block ‘datamodel_attributes_table`
read include derectives that goes after that in block and transform
into yaml2text blocks
26 27 28 29 |
# File 'lib/metanorma/plugin/lutaml/lutaml_uml_class_preprocessor.rb', line 26 def process(document, reader) input_lines = reader.readlines.to_enum Asciidoctor::Reader.new(processed_lines(document, input_lines)) end |