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.10.4-x64-mingw32 lib/nokogiri/html/builder.rb
nokogiri-1.10.4-java lib/nokogiri/html/builder.rb
zuora_connect_ui-0.7.1 vendor/ruby/2.6.0/gems/nokogiri-1.10.3/lib/nokogiri/html/builder.rb
zuora_connect_ui-0.7.0 vendor/ruby/2.6.0/gems/nokogiri-1.10.3/lib/nokogiri/html/builder.rb
nokogiri-1.10.3 lib/nokogiri/html/builder.rb
nokogiri-1.10.3-x86-mingw32 lib/nokogiri/html/builder.rb
nokogiri-1.10.3-x64-mingw32 lib/nokogiri/html/builder.rb
nokogiri-1.10.3-java lib/nokogiri/html/builder.rb
tdiary-5.0.13 vendor/bundle/gems/nokogiri-1.10.2/lib/nokogiri/html/builder.rb
tdiary-5.0.12.1 vendor/bundle/gems/nokogiri-1.10.2/lib/nokogiri/html/builder.rb
nokogiri-1.10.2 lib/nokogiri/html/builder.rb
nokogiri-1.10.2-x86-mingw32 lib/nokogiri/html/builder.rb
nokogiri-1.10.2-x64-mingw32 lib/nokogiri/html/builder.rb
nokogiri-1.10.2-java lib/nokogiri/html/builder.rb
nokogiri-1.10.1-x86-mingw32 lib/nokogiri/html/builder.rb
nokogiri-1.10.1-x64-mingw32 lib/nokogiri/html/builder.rb
nokogiri-1.10.1-java lib/nokogiri/html/builder.rb
nokogiri-1.10.1 lib/nokogiri/html/builder.rb
nokogiri-1.10.0 lib/nokogiri/html/builder.rb
nokogiri-1.10.0-x86-mingw32 lib/nokogiri/html/builder.rb