Class: IsoDoc::Iso::HtmlConvert
- Inherits:
-
HtmlConvert
- Object
- HtmlConvert
- IsoDoc::Iso::HtmlConvert
show all
- Includes:
- BaseConvert
- Defined in:
- lib/isodoc/iso/html_convert.rb
Instance Method Summary
collapse
#anchor_names, #annex, #annex_names, #annex_names1, #appendix_names, #clause_parse_title, #clausedelim, #cleanup, #convert1, #eref_localities1, #eref_localities1_zh, #error_parse, #example_p_parse, #example_parse, #example_parse1, #example_span_label, #foreword, #hierarchical_formula_names, #implicit_reference, #initial_anchor_names, #insertall_after_here, #introduction, #introduction_names, #metadata_init, #middle_title, #middle_title_amd, #middle_title_main, #node_begins_with_para, #prefix_container, #reference_names, #section_names1, #table_footnote_reference_format, #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
|