lib/metanorma/ietf/processor.rb in metanorma-ietf-2.0.7 vs lib/metanorma/ietf/processor.rb in metanorma-ietf-2.0.8
- old
+ new
@@ -15,11 +15,12 @@
{
rxl: "rxl",
xml: "xml",
rfc: "rfc.xml",
html: "html",
- txt: "txt"
+ txt: "txt",
+ pdf: "pdf"
}
end
def version
"Metanorma::Ietf #{::Metanorma::Ietf::VERSION}"
@@ -65,9 +66,20 @@
rfcname = outname.sub(/\.txt$/, ".rfc.xml")
output(isodoc_node, outname, :rfc, options) unless @done_rfc
system("xml2rfc --text #{rfcname} -o #{outname}")
+
+ when :pdf
+ unless xml2rfc_present?
+ warn "[metanorma-ietf] Error: unable to generate #{format}, the command `xml2rfc` is not found in path."
+ return
+ end
+
+ rfcname = outname.sub(/\.pdf$/, ".rfc.xml")
+ output(isodoc_node, outname, :rfc, options) unless @done_rfc
+
+ system("xml2rfc --pdf #{rfcname} -o #{outname}")
when :html
unless xml2rfc_present?
warn "[metanorma-ietf] Error: unable to generate #{format}, the command `xml2rfc` is not found in path."
return