module HTML5

Public Instance Methods

cb_env_end2() click to toggle source
# File lib/ulmul.rb, line 370
def cb_env_end2()
  case @env_label
  when /^Fig:/
    @body << "<figure id=\"#{@env_label}\">\n" << "  <img src=\"#{@env_file}\" alt=\"#{@env_file}\" />\n"
    @body << "  <figcaption>\n"
    @body << "  Figure #{@figures.length}: " << @subs_rules.call(@env_caption)
    @body << "  </figcaption>\n" << '</figure>' << "\n"
  when /^Table:/
    cb_env_end2table()
  when /^Code:/
    cb_env_end2code()
  end
end
file(stylesheets=["ulmul2html5.css"],javascripts=[],name="",language="en") click to toggle source
# File lib/ulmul.rb, line 384
  def file(stylesheets=["ulmul2html5.css"],javascripts=[],name="",language="en")
    style_lines=""
    stylesheets.each{|s| style_lines << "  <link rel=\"stylesheet\" href=\"#{s}\" type=\"text/css\" />\n"}
    javascript_lines=""
    javascripts.each{|j| javascript_lines << "  <script src=\"#{j}\" type=\"text/javascript\"></script>\n"}
    return "<!DOCTYPE html>
<html lang=\"#{language}\">
<head>
  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />
  <title>#{@title}</title>
  <meta name=\"author\" content=\"#{name}\" />
  <script type=\"text/x-mathjax-config\">
    MathJax.Hub.Config({
      tex2jax: {
        inlineMath: [ ['$','$'] ]
      }
    });
  </script>
#{style_lines}#{javascript_lines}  <link rel=\"icon\" href=\"favicon.ico\" />
</head>
<body onload=\"prettyPrint()\">
#{body()}
<hr />
<address>Copyright &#169; #{Date.today.year} #{name}</address>
</body>
</html>
"
  end