Class: IsoDoc::Iso::HtmlConvert
- Inherits:
-
HtmlConvert
- Object
- HtmlConvert
- IsoDoc::Iso::HtmlConvert
show all
- Includes:
- BaseConvert, Init
- Defined in:
- lib/isodoc/iso/html_convert.rb
Instance Method Summary
collapse
Methods included from Init
#amd, #clausedelim, #i18n_init, #metadata_init, #xref_init
#admonition_name_parse, #admonition_p_parse, #admonition_parse, #admonition_parse1, #annex, #cleanup, #convert1, #error_parse, #example_p_parse, #example_parse, #example_parse1, #example_span_label, #figure_name_parse, #foreword, #formula_where, #implicit_reference, #insertall_after_here, #introduction, #middle_title, #middle_title_amd, #middle_title_main, #node_begins_with_para, #termdef_parse, #termexamples_before_termnotes
Constructor Details
#initialize(options) ⇒ HtmlConvert
Returns a new instance of HtmlConvert.
8
9
10
11
|
# File 'lib/isodoc/iso/html_convert.rb', line 8
def initialize(options)
@libdir = File.dirname(__FILE__)
super
end
|
Instance Method Details
#default_file_locations(options) ⇒ Object
31
32
33
34
35
36
37
38
39
|
# File 'lib/isodoc/iso/html_convert.rb', line 31
def default_file_locations(options)
{
htmlstylesheet: (options[:alt] ? html_doc_path("style-human.scss") :
html_doc_path("style-iso.scss")),
htmlcoverpage: html_doc_path("html_iso_titlepage.html"),
htmlintropage: html_doc_path("html_iso_intro.html"),
scripts: html_doc_path("scripts.html"),
}
end
|
#default_fonts(options) ⇒ Object
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/isodoc/iso/html_convert.rb', line 20
def default_fonts(options)
{
bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' :
options[:alt] ? '"Lato",sans-serif' : '"Cambria",serif'),
headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' :
options[:alt] ? '"Lato",sans-serif' : '"Cambria",serif'),
monospacefont: (options[:alt] ? '"Space Mono",monospace' :
'"Courier New",monospace'),
}
end
|
41
42
43
|
# File 'lib/isodoc/iso/html_convert.rb', line 41
def (a)
a.content = a.content + ")"
end
|
#googlefonts ⇒ Object
13
14
15
16
17
18
|
# File 'lib/isodoc/iso/html_convert.rb', line 13
def googlefonts()
<<~HEAD.freeze
<link href="https://fonts.googleapis.com/css?family=Space+Mono:400,400i,700,700i&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Lato:400,400i,700,900" rel="stylesheet">
HEAD
end
|
#table_th_center(docxml) ⇒ Object
45
46
47
48
49
|
# File 'lib/isodoc/iso/html_convert.rb', line 45
def table_th_center(docxml)
docxml.xpath("//thead//th | //thead//td").each do |th|
th["style"] += ";text-align:center;vertical-align:middle;"
end
end
|