Sha256: 81a602a0593b5cf7b81ab73d4fd78c72ac03cbd115c20ed364012f9156a14a75

Contents?: true

Size: 1.01 KB

Versions: 580

Compression:

Stored size: 1.01 KB

Contents

module Nokogiri
  module HTML
    ###
    # Nokogiri HTML builder is used for building HTML documents.  It is very
    # similar to the Nokogiri::XML::Builder.  In fact, you should go read the
    # documentation for Nokogiri::XML::Builder before reading this
    # documentation.
    #
    # == Synopsis:
    #
    # Create an HTML document with a body that has an onload attribute, and a
    # span tag with a class of "bold" that has content of "Hello world".
    #
    #   builder = Nokogiri::HTML::Builder.new do |doc|
    #     doc.html {
    #       doc.body(:onload => 'some_func();') {
    #         doc.span.bold {
    #           doc.text "Hello world"
    #         }
    #       }
    #     }
    #   end
    #   puts builder.to_html
    #
    # The HTML builder inherits from the XML builder, so make sure to read the
    # Nokogiri::XML::Builder documentation.
    class Builder < Nokogiri::XML::Builder
      ###
      # Convert the builder to HTML
      def to_html
        @doc.to_html
      end
    end
  end
end

Version data entries

580 entries across 551 versions & 51 rubygems

Version Path
nokogiri-1.4.0-java lib/nokogiri/html/builder.rb
nokogiri-1.4.0-x86-mswin32 lib/nokogiri/html/builder.rb
nokogiri-1.4.0-x86-mingw32 lib/nokogiri/html/builder.rb
nokogiri-1.4.0 lib/nokogiri/html/builder.rb
nokogiri-1.3.3-x86-mswin32 lib/nokogiri/html/builder.rb
nokogiri-1.3.3-x86-mingw32 lib/nokogiri/html/builder.rb
nokogiri-1.3.3-java lib/nokogiri/html/builder.rb
nokogiri-1.3.2-x86-mswin32 lib/nokogiri/html/builder.rb
nokogiri-1.3.2-x86-mingw32 lib/nokogiri/html/builder.rb
nokogiri-1.3.2-java lib/nokogiri/html/builder.rb
nokogiri-1.3.0-x86-mingw32 lib/nokogiri/html/builder.rb
nokogiri-1.3.2 lib/nokogiri/html/builder.rb
nokogiri-1.3.3 lib/nokogiri/html/builder.rb
nokogiri-1.3.0-java lib/nokogiri/html/builder.rb
nokogiri-1.3.1-x86-mingw32 lib/nokogiri/html/builder.rb
nokogiri-1.3.1-java lib/nokogiri/html/builder.rb
nokogiri-1.3.0 lib/nokogiri/html/builder.rb
nokogiri-1.3.0-x86-mswin32 lib/nokogiri/html/builder.rb
nokogiri-1.3.1-x86-mswin32 lib/nokogiri/html/builder.rb
nokogiri-1.3.1 lib/nokogiri/html/builder.rb