module Metanorma module Input class Asciidoc < Base def process(file, filename, type) require "asciidoctor" ::Asciidoctor.convert( file, to_file: false, safe: :safe, backend: type, header_footer: true, attributes: ["nodoc", "stem", "xrefstyle=short", "docfile=#{filename}"] ) end def extract_metanorma_options(file) headerextract = file.sub(/\n\n.*$/m, "\n") /\n:mn-document-class: (?[^\n]+)\n/ =~ headerextract /\n:mn-output-extensions: (?[^\n]+)\n/ =~ headerextract { type: defined?(type) ? type : nil, extensions: defined?(extensions) ? extensions : nil, }.reject { |_, val| val.nil? } end def extract_options(file) headerextract = file.sub(/\n\n.*$/m, "\n") /\n:script: (?