Module: CGI::Html3

Defined in:
lib/rubysl/cgi/cgi.rb

Overview

Mixin module for HTML version 3 generation methods.

Instance Method Summary collapse

Instance Method Details

#doctypeObject

The DOCTYPE declaration for this version of HTML



2091
2092
2093
# File 'lib/rubysl/cgi/cgi.rb', line 2091

def doctype
  %|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">|
end

#element_initObject

Initialise the HTML generation methods for this version.



2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
# File 'lib/rubysl/cgi/cgi.rb', line 2096

def element_init
  extend TagMaker
  methods = ""
  # - -
  for element in %w[ A TT I B U STRIKE BIG SMALL SUB SUP EM STRONG
      DFN CODE SAMP KBD VAR CITE FONT ADDRESS DIV center MAP
      APPLET PRE XMP LISTING DL OL UL DIR MENU SELECT table TITLE
      STYLE SCRIPT H1 H2 H3 H4 H5 H6 TEXTAREA FORM BLOCKQUOTE
      CAPTION ]
    methods += "      def \#{element.downcase}(attributes = {})\n    BEGIN\n      end\n    END\n  end\n\n  # - O EMPTY\n  for element in %w[ IMG BASE BASEFONT BR AREA LINK PARAM HR INPUT\n      ISINDEX META ]\n    methods += <<-BEGIN + nOE_element_def(element) + <<-END\n      def \#{element.downcase}(attributes = {})\n    BEGIN\n      end\n    END\n  end\n\n  # O O or - O\n  for element in %w[ HTML HEAD BODY P PLAINTEXT DT DD LI OPTION tr\n      th td ]\n    methods += <<-BEGIN + nO_element_def(element) + <<-END\n      def \#{element.downcase}(attributes = {})\n    BEGIN\n      end\n    END\n  end\n  eval(methods)\nend\n" + nn_element_def(element) + ""