Module: CGI::Html4
- Defined in:
- lib/cgi/html.rb
Overview
Mixin module for HTML version 4 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
892 893 894 |
# File 'lib/cgi/html.rb', line 892 def doctype %|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">| end |
#element_init ⇒ Object
Initialise the HTML generation methods for this version.
897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 |
# File 'lib/cgi/html.rb', line 897 def element_init extend TagMaker return if defined?(html) methods = "" # - - for element in %w[ TT I B BIG SMALL EM STRONG DFN CODE SAMP KBD VAR CITE ABBR ACRONYM SUB SUP SPAN BDO ADDRESS DIV MAP OBJECT H1 H2 H3 H4 H5 H6 PRE Q INS DEL DL OL UL LABEL SELECT OPTGROUP FIELDSET LEGEND BUTTON TABLE 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 BR AREA LINK PARAM HR INPUT COL 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 |