Class: IsoDoc::JIS::HtmlConvert

Inherits:
Iso::HtmlConvert
  • Object
show all
Includes:
BaseConvert, Init
Defined in:
lib/isodoc/jis/html_convert.rb

Instance Method Summary collapse

Methods included from Init

#bibrenderer, #i18n_init, #metadata_init, #omit_docid_prefix, #std_docid_semantic, #xref_init

Methods included from BaseConvert

#admonition_name_parse, #annex, #commentary, #full_row, #make_tr_attr, #table_cols_count, #table_name, #table_note_cleanup, #table_parse, #table_parse_tail, #table_thead_pt, #termnote_parse

Constructor Details

#initialize(options) ⇒ HtmlConvert

Returns a new instance of HtmlConvert.



9
10
11
12
# File 'lib/isodoc/jis/html_convert.rb', line 9

def initialize(options)
  super
  @libdir = File.dirname(__FILE__)
end

Instance Method Details

#convert1(docxml, filename, dir) ⇒ Object



14
15
16
17
# File 'lib/isodoc/jis/html_convert.rb', line 14

def convert1(docxml, filename, dir)
  @options.merge!(default_fonts({})) # updated @script
  super
end

#default_file_locations(_options) ⇒ Object



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

def default_file_locations(_options)
  @libdir = File.dirname(__FILE__)
  {
    htmlstylesheet: html_doc_path("style-iso.scss"),
    htmlcoverpage: html_doc_path("html_jis_titlepage.html"),
    htmlintropage: html_doc_path("html_jis_intro.html"),
  }
end

#default_fonts(_options) ⇒ Object



19
20
21
22
23
24
25
26
27
# File 'lib/isodoc/jis/html_convert.rb', line 19

def default_fonts(_options)
  {
    bodyfont: (@script == "Jpan" ? '"MS Mincho",serif' : '"Times New Roman",serif'),
    headerfont: (@script == "Jpan" ? '"MS Gothic",sans-serif' : '"Arial",sans-serif'),
    monospacefont: '"Courier New",monospace',
    monospacefontsize: "1.0em",
    footnotefontsize: "0.9em",
  }
end

#make_table_footnote_target(out, fnid, fnref) ⇒ Object



38
39
40
41
42
43
44
45
46
47
# File 'lib/isodoc/jis/html_convert.rb', line 38

def make_table_footnote_target(out, fnid, fnref)
  attrs = { id: fnid, class: "TableFootnoteRef" }
  out.span do |s|
    s << @i18n.table_footnote
    out.span **attrs do |a|
      a << "#{fnref})"
    end
    insert_tab(s, 1)
  end
end