Module: CGI::Html4Tr

Defined in:
lib/cgi/html.rb

Overview

Mixin module for HTML version 4 transitional generation methods.

Instance Method Summary collapse

Instance Method Details

#doctypeObject

The DOCTYPE declaration for this version of HTML



942
943
944
# File 'lib/cgi/html.rb', line 942

def doctype
  %|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">|
end

#element_initObject

Initialise the HTML generation methods for this version.



947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
# File 'lib/cgi/html.rb', line 947

def element_init
  extend TagMaker
  return if defined?(html)
  methods = ""
  # - -
  for element in %w[ TT I B U S STRIKE BIG SMALL EM STRONG DFN
      CODE SAMP KBD VAR CITE ABBR ACRONYM FONT SUB SUP SPAN BDO
      ADDRESS DIV CENTER MAP OBJECT APPLET H1 H2 H3 H4 H5 H6 PRE Q
      INS DEL DL OL UL DIR MENU LABEL SELECT OPTGROUP FIELDSET
      LEGEND BUTTON TABLE IFRAME NOFRAMES TITLE STYLE SCRIPT
      NOSCRIPT TEXTAREA FORM A BLOCKQUOTE CAPTION ]
    methods << <<-BEGIN + nn_element_def(element) + <<-END
      end
    END
  end

  # - O EMPTY
  for element in %w[ IMG BASE BASEFONT BR AREA LINK PARAM HR INPUT
      COL ISINDEX META ]
    methods << <<-BEGIN + nOE_element_def(element) + <<-END
      end
    END
  end

  # O O or - O
  for element in %w[ HTML BODY P DT DD LI OPTION THEAD TFOOT TBODY
      COLGROUP TR TH TD HEAD ]
    methods << <<-BEGIN + nO_element_def(element) + <<-END
      end
    END
  end
  eval(methods)
end