diff --git a/HTMLKit.playground/Pages/Parsing Documents.xcplaygroundpage/Contents.swift b/HTMLKit.playground/Pages/Parsing Documents.xcplaygroundpage/Contents.swift
new file mode 100644
index 0000000..6b752a4
--- /dev/null
+++ b/HTMLKit.playground/Pages/Parsing Documents.xcplaygroundpage/Contents.swift
@@ -0,0 +1,29 @@
+//: [Previous](@previous)
+/*:
+# Parsing HTML Documents
+*/
+
+import HTMLKit
+
+/*:
+Given some HTML content
+*/
+
+let htmlString = try! String(contentsOfURL: [#FileReference(fileReferenceLiteral: "HTMLKit.html")#])
+
+/*:
+You can parse it using the HTMLParser:
+*/
+
+let parser = HTMLParser(string: htmlString)
+let documentViaParser = parser.parseDocument()
+documentViaParser.innerHTML
+
+/*:
+You can also create a document from a given HTML string directly:
+*/
+
+let document = HTMLDocument(string: htmlString)
+document.innerHTML
+
+//: [Next](@next)
diff --git a/HTMLKit.playground/Pages/Parsing Documents.xcplaygroundpage/timeline.xctimeline b/HTMLKit.playground/Pages/Parsing Documents.xcplaygroundpage/timeline.xctimeline
new file mode 100644
index 0000000..c5cb40d
--- /dev/null
+++ b/HTMLKit.playground/Pages/Parsing Documents.xcplaygroundpage/timeline.xctimeline
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
diff --git a/HTMLKit.playground/Pages/Parsing Fragments.xcplaygroundpage/Contents.swift b/HTMLKit.playground/Pages/Parsing Fragments.xcplaygroundpage/Contents.swift
new file mode 100644
index 0000000..37713c2
--- /dev/null
+++ b/HTMLKit.playground/Pages/Parsing Fragments.xcplaygroundpage/Contents.swift
@@ -0,0 +1,38 @@
+//: [Previous](@previous)
+/*:
+# Parsing Document Fragments
+*/
+
+import HTMLKit
+
+/*:
+Given some HTML content
+*/
+
+let htmlString = "some table data"
+
+/*:
+You can prase it as a document fragment in a specified context element:
+*/
+
+let parser = HTMLParser(string: htmlString)
+
+let tableContext = HTMLElement(tagName: "table")
+var elements = parser.parseFragmentWithContextElement(tableContext)
+
+for element in elements {
+ print(element.outerHTML)
+}
+
+/*:
+The same parser instance can be reusued:
+*/
+
+let bodyContext = HTMLElement(tagName: "body")
+elements = parser.parseFragmentWithContextElement(bodyContext)
+
+for element in elements {
+ print(element.outerHTML)
+}
+
+//: [Next](@next)
diff --git a/HTMLKit.playground/Pages/Parsing Fragments.xcplaygroundpage/timeline.xctimeline b/HTMLKit.playground/Pages/Parsing Fragments.xcplaygroundpage/timeline.xctimeline
new file mode 100644
index 0000000..43c4189
--- /dev/null
+++ b/HTMLKit.playground/Pages/Parsing Fragments.xcplaygroundpage/timeline.xctimeline
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/HTMLKit.playground/Pages/The DOM.xcplaygroundpage/Contents.swift b/HTMLKit.playground/Pages/The DOM.xcplaygroundpage/Contents.swift
new file mode 100644
index 0000000..a67a13f
--- /dev/null
+++ b/HTMLKit.playground/Pages/The DOM.xcplaygroundpage/Contents.swift
@@ -0,0 +1,79 @@
+//: [Previous](@previous)
+/*:
+# The DOM
+
+HTMLKit provides a rich DOM implementation for manipulating and navigating the document tree. Here are some of the features:
+*/
+
+import HTMLKit
+
+let htmlString = ""
+let document = HTMLDocument(string: htmlString)
+
+/*:
+Create new elements and assign attributes
+*/
+
+let description = HTMLElement(tagName:"meta", attributes: ["name": "description"])
+description["content"] = "HTMLKit for iOS & OSX"
+
+/*:
+Append nodes to the document
+*/
+let head = document.head!
+head.appendNode(description)
+document.innerHTML
+
+let body = document.body!
+let nodes = [
+ HTMLElement(tagName: "div", attributes: ["class": "red"]),
+ HTMLElement(tagName: "div", attributes: ["class": "green"]),
+ HTMLElement(tagName: "div", attributes: ["class": "blue"])
+]
+body.appendNodes(nodes)
+body.innerHTML
+
+/*:
+Enumerate child elements and perform DOM manipulation
+*/
+body.enumerateChildElementsUsingBlock { (element, index, stop) -> Void in
+ if element.tagName == "div" {
+ let lorem = HTMLElement(tagName: "p")
+ lorem.textContent = "Lorem ipsum: \(index)"
+ element.appendNode(lorem)
+ }
+}
+body.innerHTML
+
+/*:
+Remove nodes from the document
+*/
+body.removeChildNodeAtIndex(1)
+body.innerHTML
+
+/*:
+Navigate to child and sibling nodes
+*/
+body.lastChild!.removeFromParentNode()
+let greenDiv = body.firstChild!.nextSibling!
+
+/*:
+Manipulate the HTML directly
+*/
+greenDiv.innerHTML = "- item 1
- item 2"
+
+/*:
+Iterate the DOM tree with custom filters
+*/
+let filter = HTMLNodeFilterBlock.filterWithBlock { (node) -> HTMLNodeFilterValue in
+ if node.childNodesCount() != 1 {
+ return .Reject
+ }
+ return .Accept
+}
+
+for element in body.nodeIteratorWithShowOptions(.Element, filter: filter) {
+ element.outerHTML
+}
+
+//: [Next](@next)
diff --git a/HTMLKit.playground/Pages/The DOM.xcplaygroundpage/timeline.xctimeline b/HTMLKit.playground/Pages/The DOM.xcplaygroundpage/timeline.xctimeline
new file mode 100644
index 0000000..cebe428
--- /dev/null
+++ b/HTMLKit.playground/Pages/The DOM.xcplaygroundpage/timeline.xctimeline
@@ -0,0 +1,150 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/HTMLKit.playground/Pages/Demo.xcplaygroundpage/Resources/HTMLKit.html b/HTMLKit.playground/Resources/HTMLKit.html
similarity index 71%
rename from HTMLKit.playground/Pages/Demo.xcplaygroundpage/Resources/HTMLKit.html
rename to HTMLKit.playground/Resources/HTMLKit.html
index cff82fd..a9ca358 100644
--- a/HTMLKit.playground/Pages/Demo.xcplaygroundpage/Resources/HTMLKit.html
+++ b/HTMLKit.playground/Resources/HTMLKit.html
@@ -4,7 +4,7 @@
HTMLKit
- HTMLKit is a WHATWG specification-compliant Objective-C library for parsing and serializing HTML documents and document fragments for OSX and iOS.
+ HTMLKit is a WHATWG specification-compliant Objective-C framework for parsing and serializing HTML documents and document fragments for iOS and OSX.
HTMLKit parses real-world HTML the same way modern web browsers would.
HTMLKit comes armed with a CSS3 Selectors engine for querying the DOM.
diff --git a/HTMLKit.playground/contents.xcplayground b/HTMLKit.playground/contents.xcplayground
index 19f1126..d961153 100644
--- a/HTMLKit.playground/contents.xcplayground
+++ b/HTMLKit.playground/contents.xcplayground
@@ -1,7 +1,10 @@
-
+
-
+
+
+
+
\ No newline at end of file
|