lib/metanorma/standoc/processor.rb in metanorma-standoc-1.10.0 vs lib/metanorma/standoc/processor.rb in metanorma-standoc-1.10.1

- old
+ new

@@ -1,35 +1,44 @@ require "metanorma/processor" module Metanorma module Standoc class Processor < Metanorma::Processor - - def initialize + def initialize # rubocop:disable Lint/MissingSuper @short = :standoc @input_format = :asciidoc @asciidoctor_backend = :standoc end def output_formats super.merge( html: "html", - doc: "doc" + doc: "doc", ) end def version "Metanorma::Standoc #{Metanorma::Standoc::VERSION}/IsoDoc #{IsoDoc::VERSION}" end - def output(isodoc_node, inname, outname, format, options={}) + def html_path(file) + File.join(File.dirname(__FILE__), "..", "..", "isodoc", "html", file) + end + + def output(isodoc_node, inname, outname, format, options = {}) case format when :html - IsoDoc::HtmlConvert.new(options).convert(inname, isodoc_node, nil, outname) + options = options + .merge(htmlstylesheet: html_path("htmlstyle.scss"), + htmlcoverpage: html_path("html_titlepage.html")) + IsoDoc::HtmlConvert.new(options) + .convert(inname, isodoc_node, nil, outname) when :doc - IsoDoc::WordConvert.new(options).convert(inname, isodoc_node, nil, outname) + IsoDoc::WordConvert.new(options) + .convert(inname, isodoc_node, nil, outname) when :presentation - IsoDoc::PresentationXMLConvert.new(options).convert(inname, isodoc_node, nil, outname) + IsoDoc::PresentationXMLConvert.new(options) + .convert(inname, isodoc_node, nil, outname) else super end end end