Sha256: 0c352e228e0e5d42aa5a639c93f4cd5337b6444fc3233176e047830503b43dfc

Contents?: true

Size: 867 Bytes

Versions: 5

Compression:

Stored size: 867 Bytes

Contents

# frozen_string_literal: true

module Metanorma
  module Plugin
    module Lutaml
      class LutamlGmlDictionaryBlockMacro < ::Asciidoctor::Extensions::BlockMacroProcessor
        include LutamlGmlDictionaryBase
        use_dsl
        named :lutaml_gml_dictionary

        def process(parent, target, attrs)
          tmpl = gml_dictionary_template(
            parent.document,
            attrs["template"],
          )

          render(tmpl, parent, attrs, target)
        end

        private

        def gml_dictionary_template(document, template_path)
          if template_path.nil?
            document.logger.warn("Template not found!")
          end

          rel_tmpl_path = Utils.relative_file_path(
            document, template_path
          )

          ::Liquid::Template.parse(File.read(rel_tmpl_path))
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
metanorma-plugin-lutaml-0.7.6 lib/metanorma/plugin/lutaml/lutaml_gml_dictionary_block_macro.rb
metanorma-plugin-lutaml-0.7.5 lib/metanorma/plugin/lutaml/lutaml_gml_dictionary_block_macro.rb
metanorma-plugin-lutaml-0.7.4 lib/metanorma/plugin/lutaml/lutaml_gml_dictionary_block_macro.rb
metanorma-plugin-lutaml-0.7.3 lib/metanorma/plugin/lutaml/lutaml_gml_dictionary_block_macro.rb
metanorma-plugin-lutaml-0.7.2 lib/metanorma/plugin/lutaml/lutaml_gml_dictionary_block_macro.rb