Class: Metanorma::Standoc::Datamodel::DiagramPreprocessor

Inherits:
Asciidoctor::Extensions::Preprocessor
  • Object
show all
Defined in:
lib/metanorma/standoc/datamodel/diagram_preprocessor.rb

Constant Summary collapse

BLOCK_START_REGEXP =
/\{(.+?)\.\*,(.+),(.+)\}/.freeze
BLOCK_END_REGEXP =
/\A\{[A-Z]+\}\z/.freeze
MARCO_REGEXP =
/\[datamodel_diagram,([^,]+),?(.+)?\]/.freeze
TEMPLATES_PATH =
File.expand_path("../views/datamodel", __dir__).freeze

Instance Method Summary collapse

Instance Method Details

#process(document, reader) ⇒ Object

search document for block ‘datamodel_diagram`

read include derectives that goes after that in block and transform
into plantuml block


17
18
19
20
# File 'lib/metanorma/standoc/datamodel/diagram_preprocessor.rb', line 17

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