From 0e8d1d9d28d127704897bb9fb4ea06105a1d0f84 Mon Sep 17 00:00:00 2001 From: Benjamin Kellermann Date: Thu, 19 Nov 2009 20:00:05 +0100 Subject: startet to use html element for output --- html.rb | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 html.rb (limited to 'html.rb') diff --git a/html.rb b/html.rb new file mode 100644 index 0000000..93739ba --- /dev/null +++ b/html.rb @@ -0,0 +1,53 @@ + +class HTML + attr_accessor :title, :htmlout, :header + def initialize + @header = {} + @header["type"] = "text/html" +# @header["type"] = "application/xhtml+xml" + @header["charset"] = "utf-8" + + @htmlout = < + +HEAD + @css = {} + @atom = [] + end + def add_head(title) + @htmlout += < + + + #{title} +HEAD + @css.each{|title,href| + @htmlout += "" + @htmlout += "" if title == "print" + } + + @atom.each{|href| + @htmlout += "" + } + + @htmlout += "" + end + def add_css(href, title = "default") + @css[title] ||= [] + @css[title] << href + end + def add_atom(href) + @atom << href + end + def add_tabs + @htmlout += < + + +HEAD + end +end -- cgit v1.2.3