Module: HTML5

Included in:
Ulmul
Defined in:
lib/ulmul.rb

Instance Method Summary collapse

Instance Method Details

#cb_env_end2Object



370
371
372
373
374
375
376
377
378
379
380
381
382
# 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") ⇒ Object



384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
# 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