Module: CGI::Html3
- Defined in:
- lib/cgi/html.rb
Overview
Mixin module for HTML version 3 generation methods.
Instance Method Summary collapse
-
#doctype ⇒ Object
The DOCTYPE declaration for this version of HTML.
-
#element_init ⇒ Object
Initialise the HTML generation methods for this version.
Instance Method Details
#doctype ⇒ Object
The DOCTYPE declaration for this version of HTML
841 842 843 |
# File 'lib/cgi/html.rb', line 841 def doctype %|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">| end |
#element_init ⇒ Object
Initialise the HTML generation methods for this version.
846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 |
# File 'lib/cgi/html.rb', line 846 def element_init extend TagMaker return if defined?(html) 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) + "" |