lib/metanorma/compile.rb in metanorma-0.3.10 vs lib/metanorma/compile.rb in metanorma-0.3.11
- old
+ new
@@ -92,12 +92,14 @@
def process_input(filename, options)
case extname = File.extname(filename)
when ".adoc"
puts "[metanorma] Processing: Asciidoctor input."
file = File.read(filename, encoding: "utf-8")
- if options[:asciimath]
+ options[:asciimath] and
file.sub!(/^(=[^\n]+\n)/, "\\1:mn-keep-asciimath:\n")
- end
+ dir = File.dirname(filename)
+ dir != '.' and
+ file.gsub!(/^include::/, "include::#{dir}/")
[file, @processor.input_to_isodoc(file, filename)]
when ".xml"
puts "[metanorma] Processing: Metanorma XML input."
# TODO NN: this is a hack -- we should provide/bridge the
# document attributes in Metanorma XML