Class: Metanorma::Plugin::Lutaml::LutamlPreprocessor
- Inherits:
-
Asciidoctor::Extensions::Preprocessor
- Object
- Asciidoctor::Extensions::Preprocessor
- Metanorma::Plugin::Lutaml::LutamlPreprocessor
- Defined in:
- lib/metanorma/plugin/lutaml/lutaml_preprocessor.rb
Overview
Class for processing Lutaml files
Constant Summary collapse
- REMARKS_ATTRIBUTE =
"remarks"
Instance Method Summary collapse
Instance Method Details
#process(document, reader) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/metanorma/plugin/lutaml/lutaml_preprocessor.rb', line 18 def process(document, reader) r = Asciidoctor::PreprocessorNoIfdefsReader.new document, reader.lines input_lines = r.readlines.to_enum has_lutaml = !input_lines.select { |x| lutaml?(x) }.empty? express_indexes = Utils.parse_document_express_indexes( document, input_lines ) result_content = processed_lines(document, input_lines, express_indexes) has_lutaml and log(document, result_content) Asciidoctor::PreprocessorNoIfdefsReader.new(document, result_content) end |