lib/isodoc/csd/csdconvert.rb in asciidoctor-csd-0.4.4 vs lib/isodoc/csd/csdconvert.rb in asciidoctor-csd-0.4.5
- old
+ new
@@ -4,31 +4,29 @@
module IsoDoc
module Csd
# A {Converter} implementation that generates CSD output, and a document
# schema encapsulation of the document for validation
class HtmlConvert < IsoDoc::HtmlConvert
- def html_doc_path(file)
- File.join(File.dirname(__FILE__), File.join("html", file))
- end
-
def initialize(options)
+ @libdir = File.dirname(__FILE__)
super
- @htmlstylesheet = generate_css(html_doc_path("htmlstyle.scss"), true, default_fonts(options))
- # @standardstylesheet = generate_css(html_doc_path("csd.scss"), true, default_fonts(options))
- @htmlcoverpage = html_doc_path("html_csd_titlepage.html")
- @htmlintropage = html_doc_path("html_csd_intro.html")
- @scripts = html_doc_path("scripts.html")
end
def default_fonts(options)
- b = options[:bodyfont] ||
- (options[:script] == "Hans" ? '"SimSun",serif' :
- '"Overpass",sans-serif')
- h = options[:headerfont] ||
- (options[:script] == "Hans" ? '"SimHei",sans-serif' :
- '"Overpass",sans-serif')
- m = options[:monospacefont] || '"Space Mono",monospace'
- "$bodyfont: #{b};\n$headerfont: #{h};\n$monospacefont: #{m};\n"
+ {
+ bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Overpass",sans-serif'),
+ headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Overpass",sans-serif'),
+ monospacefont: '"Space Mono",monospace'
+ }
+ end
+
+ def default_file_locations(options)
+ {
+ htmlstylesheet: html_doc_path("htmlstyle.scss"),
+ htmlcoverpage: html_doc_path("html_csd_titlepage.html"),
+ htmlintropage: html_doc_path("html_csd_intro.html"),
+ scripts: html_doc_path("scripts.html"),
+ }
end
def metadata_init(lang, script, labels)
@meta = Metadata.new(lang, script, labels)
end