Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some documentation for XML module. #2584

Merged
merged 1 commit into from
May 13, 2016

Conversation

Hamdiakoguz
Copy link
Contributor

Added comments to methods in XML::Node mostly taking nokogiri as a reference.
Also added a usage example to XML module.

@oprypin
Copy link
Member

oprypin commented May 12, 2016

Welp, apparently the crazy code formatting tool is now mandatory. You can run crystal tool format command and apply these changes to make the build pass.

diff --git a/src/xml/xml.cr b/src/xml/xml.cr
index b362c31..9b34665 100644
--- a/src/xml/xml.cr
+++ b/src/xml/xml.cr
@@ -13,16 +13,16 @@
 #  </person>
 # XML
 #
-# document = XML.parse(xml) # : XML::Node
+# document = XML.parse(xml)             # : XML::Node
 # person = document.first_element_child # : XML::Node?
 # if person
 #   puts person["id"] # "1" : String?
 #
-#   puts typeof(person.children) # XML::NodeSet
+#   puts typeof(person.children)                       # XML::NodeSet
 #   person.children.select(&.element?).each do |child| # Select only element children
-#     puts typeof(child) # XML::Node
-#     puts child.name # firstname : String
-#     puts child.content # Jane : String?
+#     puts typeof(child)                               # XML::Node
+#     puts child.name                                  # firstname : String
+#     puts child.content                               # Jane : String?
 #   end
 # end
 # ```

@Hamdiakoguz
Copy link
Contributor Author

@BlaXpirit Thanks, I ran the tool and updated the code.

@asterite
Copy link
Member

@Hamdiakoguz this is excellent, thank you so much! ❤️ ❤️ ❤️

@asterite asterite merged commit 2267a28 into crystal-lang:master May 13, 2016
@Hamdiakoguz Hamdiakoguz deleted the docs-xml branch May 28, 2016 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants