Module: CGI::Html3

Defined in:
lib/laser/standard_library/cgi/html.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



841
842
843
# File 'lib/laser/standard_library/cgi/html.rb', line 841

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

#element_initObject

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
# File 'lib/laser/standard_library/cgi/html.rb', line 846

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 += <<-BEGIN + nn_element_def(element) + <<-END
      end
    END
  end

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

  # O O or - O
  for element in %w[ HTML HEAD BODY P PLAINTEXT DT DD LI OPTION tr
      th td ]
    methods += <<-BEGIN + nO_element_def(element) + <<-END
      end
    END
  end
  eval(methods)
end