Module: XHTML

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

Instance Method Summary collapse

Instance Method Details

#cb_env_end2Object



415
416
417
418
419
420
421
422
423
424
425
426
427
428
# File 'lib/ulmul.rb', line 415

def cb_env_end2()
  case @env_label
  when /^Fig:/
    @body << "<div class=\"figure\" id=\"#{@env_label}\">\n" << "  <img src=\"#{@env_file}\" alt=\"#{@env_file}\" />\n"
    @body << "  <div class=\"figcaption\">\n"
    @body << "  Figure #{@figures.length}. " << @subs_rules.call(@env_caption)
    @body << "  </div>\n"
    @body << '</div>' << "\n"
  when /^Table:/
    cb_env_end2table()
  when /^Code:/
    cb_env_end2code()
  end
end

#file(stylesheets = ["ulmul2xhtml.css"], javascripts = [], name = "", language = "en") ⇒ Object



430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
# File 'lib/ulmul.rb', line 430

def file(stylesheets=["ulmul2xhtml.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 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE html
PUBLIC \"-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN\"
       \"http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">

<head>
<meta name=\"language\" content=\"#{language}\" />
<title>#{@title}</title>
<meta name=\"author\" content=\"#{name}\" />
<meta name=\"copyright\" content=\"Copyright &#169; #{Date.today.year} #{name}\" />
#{style_lines}#{javascript_lines}  <link rel=\"icon\" href=\"favicon.ico\" />
</head>
<body onload=\"prettyPrint()\">
#{body()}
</body>
</html>
"
end