metanorma-generic 1.9.0 → 1.10.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,66 +0,0 @@
1
- require_relative "base_convert"
2
- require_relative "init"
3
- require "isodoc"
4
-
5
- module IsoDoc
6
- module Generic
7
- # A {Converter} implementation that generates PDF HTML output, and a
8
- # document schema encapsulation of the document for validation
9
- class PdfConvert < IsoDoc::PdfConvert
10
- def initialize(options)
11
- @libdir = File.dirname(__FILE__)
12
- super
13
- end
14
-
15
- class << self
16
- attr_accessor :_file
17
- end
18
-
19
- def self.inherited( k )
20
- k._file = caller_locations.first.absolute_path
21
- end
22
-
23
- def default_fonts(options)
24
- {
25
- bodyfont: (options[:script] == "Hans" ? '"Source Han Sans",serif'
26
- : configuration.html_bodyfont || '"Overpass",sans-serif'),
27
- headerfont: (options[:script] == "Hans" ? '"Source Han Sans",sans-serif' :
28
- configuration.html_headerfont || '"Overpass",sans-serif'),
29
- monospacefont: configuration.html_monospacefont || '"Space Mono",monospace'
30
- }.transform_values { |v| v&.empty? ? nil : v }
31
- end
32
-
33
- def default_file_locations(_options)
34
- {
35
- htmlstylesheet: baselocation(configuration.htmlstylesheet) ||
36
- html_doc_path("htmlstyle.scss"),
37
- htmlcoverpage: baselocation(configuration.htmlcoverpage) ||
38
- html_doc_path("html_generic_titlepage.html"),
39
- htmlintropage: baselocation(configuration.htmlintropage) ||
40
- html_doc_path("html_generic_intro.html"),
41
- scripts_pdf: baselocation(configuration.scripts_pdf) ||
42
- html_doc_path("scripts.pdf.html")
43
- }.transform_values { |v| v&.empty? ? nil : v }
44
- end
45
-
46
- def googlefonts
47
- <<~HEAD.freeze
48
- <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700" rel="stylesheet">
49
- <link href="https://fonts.googleapis.com/css?family=Overpass:300,300i,600,900" rel="stylesheet">
50
- HEAD
51
- end
52
-
53
- def html_toc(docxml)
54
- docxml
55
- end
56
-
57
- def configuration
58
- Metanorma::Generic.configuration
59
- end
60
-
61
- include BaseConvert
62
- include Init
63
- end
64
- end
65
- end
66
-