Class: Metanorma::Output::XslfoPdf

Inherits:
Base
  • Object
show all
Defined in:
lib/metanorma/output/xslfo.rb

Instance Method Summary collapse

Instance Method Details

#convert(url_path, output_path, xsl_stylesheet, options = "") ⇒ Object



7
8
9
10
11
# File 'lib/metanorma/output/xslfo.rb', line 7

def convert(url_path, output_path, xsl_stylesheet, options = "")
  return if url_path.nil? || output_path.nil? || xsl_stylesheet.nil?

  Mn2pdf.convert(quote(url_path), quote(output_path), quote(xsl_stylesheet), options)
end

#quote(x) ⇒ Object



13
14
15
16
17
# File 'lib/metanorma/output/xslfo.rb', line 13

def quote(x)
  return x if /^'.*'$/.match(x)
  return x if /^".*"$/.match(x)
  %("#{x}")
end