Files

Markaby::BuilderTags

Public Instance Methods

head(*args, &block) click to toggle source

Builds a head tag. Adds a meta tag inside with Content-Type set to text/html; charset=utf-8.

    # File lib/markaby/builder_tags.rb, line 29
29:     def head(*args, &block)
30:       tag!(:head, *args) do
31:         tag!(:meta, "http-equiv" => "Content-Type", "content" => "text/html; charset=utf-8") if @output_meta_tag
32:         instance_eval(&block)
33:       end
34:     end
html_tag(sym, *args, &block) click to toggle source

Every HTML tag method goes through an html_tag call. So, calling div is equivalent to calling html_tag(:div). All HTML tags in Markaby’s list are given generated wrappers for this method.

If the @auto_validation setting is on, this method will check for many common mistakes which could lead to invalid XHTML.

    # File lib/markaby/builder_tags.rb, line 17
17:     def html_tag(sym, *args, &block)
18:       if @auto_validation && @tagset.self_closing.include?(sym) && block
19:         raise InvalidXhtmlError, "the `#{sym}' element is self-closing, please remove the block"
20:       elsif args.empty? && !block
21:         CssProxy.new(self, @streams.last, sym)
22:       else
23:         tag!(sym, *args, &block)
24:       end
25:     end
xhtml_frameset(attrs = {}, &block) click to toggle source

Builds an html tag with XHTML 1.0 Frameset doctype instead.

    # File lib/markaby/builder_tags.rb, line 51
51:     def xhtml_frameset(attrs = {}, &block)
52:       self.tagset = Markaby::XHTMLFrameset
53:       xhtml_html(attrs, &block)
54:     end
xhtml_strict(attrs = {}, &block) click to toggle source

Builds an html tag with XHTML 1.0 Strict doctype instead.

    # File lib/markaby/builder_tags.rb, line 45
45:     def xhtml_strict(attrs = {}, &block)
46:       self.tagset = Markaby::XHTMLStrict
47:       xhtml_html(attrs, &block)
48:     end
xhtml_transitional(attrs = {}, &block) click to toggle source

Builds an html tag. An XML 1.0 instruction and an XHTML 1.0 Transitional doctype are prepended. Also assumes :xmlns => "www.w3.org/1999/xhtml", :lang => "en".

    # File lib/markaby/builder_tags.rb, line 39
39:     def xhtml_transitional(attrs = {}, &block)
40:       self.tagset = Markaby::XHTMLTransitional
41:       xhtml_html(attrs, &block)
42:     end

Private Instance Methods

xhtml_html(attrs = {}, &block) click to toggle source
    # File lib/markaby/builder_tags.rb, line 58
58:     def xhtml_html(attrs = {}, &block)
59:       instruct! if @output_xml_instruction
60:       declare!(:DOCTYPE, :html, :PUBLIC, *tagset.doctype)
61:       tag!(:html, @root_attributes.merge(attrs), &block)
62:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.