Method: IsoDoc::HtmlFunction::Html#htmlstyle

Defined in:
lib/isodoc/html_function/postprocess_cover.rb

#htmlstyle(docxml) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/isodoc/html_function/postprocess_cover.rb', line 28

def htmlstyle(docxml)
  return docxml unless @htmlstylesheet

  head = docxml.at("//*[local-name() = 'head']")
  head << htmlstylesheet(@htmlstylesheet)
  s = htmlstylesheet(@htmlstylesheet_override) and head << s
  s = @meta.get[:code_css] and
    head << "<style><!--#{s.gsub(/sourcecode/,
                                 'pre.sourcecode')}--></style>"
  @bare and
    head << "<style>body {margin-left: 2em; margin-right: 2em;}</style>"
  docxml
end