Class: IsoDoc::Mpfd::PdfConvert
- Inherits:
-
PdfConvert
- Object
- PdfConvert
- IsoDoc::Mpfd::PdfConvert
show all
- Includes:
- BaseConvert
- Defined in:
- lib/isodoc/mpfd/pdf_convert.rb
Overview
A Converter implementation that generates PDF HTML output, and a document schema encapsulation of the document for validation
Constant Summary
Constants included
from BaseConvert
BaseConvert::FRONT_CLAUSE, BaseConvert::SECTIONS_XPATH, BaseConvert::TERM_CLAUSE
Instance Method Summary
collapse
#annex_name, #annex_name_lbl, #annex_names, #annex_names1, #annex_naming, #clause, #clause_names, #clause_parse_title, #container_names, #convert1, #fileloc, #i18n_init, #initial_anchor_names, #metadata_init, #middle, #ol_depth, #preface, #sect_names, #termdef_parse, #terms_defs, #terms_defs_title
Constructor Details
#initialize(options) ⇒ PdfConvert
Returns a new instance of PdfConvert.
9
10
11
12
|
# File 'lib/isodoc/mpfd/pdf_convert.rb', line 9
def initialize(options)
@libdir = File.dirname(__FILE__)
super
end
|
Instance Method Details
#default_file_locations(_options) ⇒ Object
24
25
26
27
28
29
30
31
|
# File 'lib/isodoc/mpfd/pdf_convert.rb', line 24
def default_file_locations(_options)
{
htmlstylesheet: html_doc_path("htmlstyle.scss"),
htmlcoverpage: html_doc_path("html_rsd_titlepage.html"),
htmlintropage: html_doc_path("html_rsd_intro.html"),
scripts_pdf: html_doc_path("scripts.pdf.html"),
}
end
|
#default_fonts(options) ⇒ Object
16
17
18
19
20
21
22
|
# File 'lib/isodoc/mpfd/pdf_convert.rb', line 16
def default_fonts(options)
{
bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Titillium Web",sans-serif'),
headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Titillium Web",sans-serif'),
monospacefont: '"Space Mono",monospace'
}
end
|
#googlefonts ⇒ Object
33
34
35
36
37
38
39
|
# File 'lib/isodoc/mpfd/pdf_convert.rb', line 33
def googlefonts()
<<~HEAD.freeze
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Overpass:300,300i,600,900" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Titillium+Web:400,400i,700,700i" rel="stylesheet">
HEAD
end
|
#html_toc(docxml) ⇒ Object
50
51
52
|
# File 'lib/isodoc/mpfd/pdf_convert.rb', line 50
def html_toc(docxml)
docxml
end
|
#make_body(xml, docxml) ⇒ Object
41
42
43
44
45
46
47
48
|
# File 'lib/isodoc/mpfd/pdf_convert.rb', line 41
def make_body(xml, docxml)
body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72", "xml:lang": "EN-US", class: "container" }
xml.body **body_attr do |body|
make_body1(body, docxml)
make_body2(body, docxml)
make_body3(body, docxml)
end
end
|
#make_body3(body, docxml) ⇒ Object
54
55
56
57
58
59
60
61
|
# File 'lib/isodoc/mpfd/pdf_convert.rb', line 54
def make_body3(body, docxml)
body.div **{ class: "main-section" } do |div3|
preface docxml, div3
middle docxml, div3
div3
div3
end
end
|