module Markaby::BuilderTags
def enable_html5!
def enable_html5! raise NotImplementedError, "Deprecated! Call self.tagset = Markaby::HTML5" end
def head(*args, &block)
Builds a head tag. Adds a meta tag inside with Content-Type
def head(*args, &block) tag!(:head, *args) do tag!(:meta, "http-equiv" => "Content-Type", "content" => "text/html; charset=utf-8") if @output_meta_tag == "xhtml" tag!(:meta, "charset" => "utf-8") if @output_meta_tag == "html5" instance_eval(&block) end end
def html5(attrs = {}, &block)
def html5(attrs = {}, &block) self.tagset = Markaby::HTML5 html5_html(attrs, &block) end
def html5_html(attrs = {}, &block)
def html5_html(attrs = {}, &block) declare!(:DOCTYPE, :html) tag!(:html, @root_attributes.merge(attrs), &block) end
def html_tag(sym, *args, &block)
If the @auto_validation setting is on, this method will check for many common mistakes which
for this method.
to calling html_tag(:div). All HTML tags in Markaby's list are given generated wrappers
Every HTML tag method goes through an html_tag call. So, calling div is equivalent
def html_tag(sym, *args, &block) if @auto_validation && @tagset.self_closing.include?(sym) && block raise InvalidXhtmlError, "the `#{sym}' element is self-closing, please remove the block" elsif args.empty? && !block CssProxy.new(self, @streams.last, sym) else tag!(sym, *args, &block) end end
def xhtml_frameset(attrs = {}, &block)
def xhtml_frameset(attrs = {}, &block) self.tagset = Markaby::XHTMLFrameset xhtml_html(attrs, &block) end
def xhtml_html(attrs = {}, &block)
def xhtml_html(attrs = {}, &block) instruct! if @output_xml_instruction declare!(:DOCTYPE, :html, :PUBLIC, *tagset.doctype) tag!(:html, @root_attributes.merge(attrs), &block) end
def xhtml_strict(attrs = {}, &block)
def xhtml_strict(attrs = {}, &block) self.tagset = Markaby::XHTMLStrict xhtml_html(attrs, &block) end
def xhtml_transitional(attrs = {}, &block)
are prepended. Also assumes :xmlns => "http://www.w3.org/1999/xhtml",
Builds an html tag. An XML 1.0 instruction and an XHTML 1.0 Transitional doctype
def xhtml_transitional(attrs = {}, &block) self.tagset = Markaby::XHTMLTransitional xhtml_html(attrs, &block) end