Class: IsoDoc::Iso::HtmlConvert

Inherits:
HtmlConvert
  • Object
show all
Includes:
BaseConvert
Defined in:
lib/isodoc/iso/html_convert.rb

Instance Method Summary collapse

Methods included from BaseConvert

#annex_names, #annex_names1, #appendix_names, #clausedelim, #eref_localities1, #eref_localities1_zh, #error_parse, #example_p_parse, #example_parse, #example_parse1, #foreword, #implicit_reference, #initial_anchor_names, #introduction, #introduction_names, #load_yaml, #metadata_init, #prefix_container, #section_names1, #term_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



21
22
23
24
25
26
27
28
# File 'lib/isodoc/iso/html_convert.rb', line 21

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



13
14
15
16
17
18
19
# File 'lib/isodoc/iso/html_convert.rb', line 13

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

#insertall_after_here(node, insert, name) ⇒ Object



30
31
32
33
34
35
36
37
# File 'lib/isodoc/iso/html_convert.rb', line 30

def insertall_after_here(node, insert, name)
  node.children.each do |n|
    next unless n.name == name
    insert.next = n.remove
    insert = n
  end
  insert
end