crystagiri v0.1.0 Release Notes

Release Date: 2016-12-09 // over 7 years ago
  • Initial release

    📜 In this first version you can only parse Html file represented by Crystagiri::HTML. You can instanciate it from :

    doc = Crystagiri::HTML.new "\<h1\>Crystagiri is awesome!!\</h1\>"doc = Crystagiri::HTML.from\_file "README.md"doc = Crystagiri::HTML.from\_url "http://example.com/"
    

    Then you can search all XML::Node by:

    • HTML tag

      doc.tag("h2") { |node| puts node }# => <h2> .. </h2># => <h2> .. </h2># => <h2> .. </h2>

    • HTML id

      puts doc.at_id("main-content") # => <div id="main-content"> ... </div>

    • HTML class attribute

      doc.class("summary") { |node| puts node }# => <div class="summary"> .. </div># => <div class="summary"> .. </div># => <div class="summary"> .. </div>